In MS Access 2007, I am having difficulty with the syntax for a field validation using a date range for current year.
For example, >= #1/1/2013# And <#1/1/2014# will prevent users from entering a date before 1/1/2013 and after 1/1/2014.
The problem is I need this to transfer from year to year without updating the year, so I would need something like >="1/1/" & format(date()," yyyy") and <="12/31/" & format(date()," yyyy"). But I cannot seem to get this to work.
I have tried using the validation on the form in a before BeforeUpdate(Ca ncel As Integer) sub, but I get a validation error. Help!
For example, >= #1/1/2013# And <#1/1/2014# will prevent users from entering a date before 1/1/2013 and after 1/1/2014.
The problem is I need this to transfer from year to year without updating the year, so I would need something like >="1/1/" & format(date()," yyyy") and <="12/31/" & format(date()," yyyy"). But I cannot seem to get this to work.
I have tried using the validation on the form in a before BeforeUpdate(Ca ncel As Integer) sub, but I get a validation error. Help!
Comment