Give us more details. How are you using it? If you put it in a recordsource without the parentheses '=Date' then Access will put brackets around it and assume it's a field name '=[Date]'
It sounds like you have a global variable or a field named 'date' somewhere in your project which is causing an ambiguous reference. I've done that before and once I confused VB by using the reserved word as a variable, it wouldn't straighten out even after I deleted the variable.
Have you tried to compile the program to see if it will pinpoint what is making it angry?
As a last resort you could use:
Code:
myDate = Format(Now, "mm/dd/yy")
Sometimes this kind of behavior is caused by a missing reference. Open your references window and check to see if the word "MISSING" is next to any of your references.
Try using the cdate()function. Example: cdate("10/11/2002" This is a safe to use function for date validation and proper format when writing to an Access or SQL date field.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.