strSQL = "UPDATE tblCurentPastYears SET DateFrom = #1/1/" & Me.txtY & " # WHERE DateFrom is Null;"
if in the txtY control it says 2026 otherwise use
strSQL = "UPDATE tblCurentPastYears SET DateFrom = #1/1/" & Year(Date()) & "# WHERE DateFrom is Null;"
This could be another kind of solution.
However the database structure has many things that need to be improved:
Normalizationcorrect
management of field Properties (Required and Indexed in particular)
Indexes to prevent creating duplicates
etc...
You have to compact it first and then compress it.
If it remains too large you have to post the compressed file on a data sharing site, such as FileTransfer.
When you create the supplier you have to say if the lot should be automatic or manual, once you do this you block or not the txtLotNumber control depending on your choice.
Try this update.
The fact remains that the database is quite poorly made, suffice it to say that in the LotNumberF mask by not inserting the date or inserting a date after today's the record is still saved, etc...
First make a copy of the current file.
On the current file you only have to comment the line where the error is highlighted by placing a quote (apostrophe) at the beginning of it.
In the case of errors in an If loop you have to comment all the lines of the same from If to End If.
You need to change the line
Price = Nz(DLookup([Price], [OrderDetailsQ], "ProductDetailsID=" & Me.ProductCmb), 0)
in the following
Price = Nz(DLookup("[Price]", "[OrderDetailsQ]", "ProductDetailsID=" & Me.ProductCmb), 0)