Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use 'date' function, not 'date' variable or field 1

Status
Not open for further replies.

xhonzi

Programmer
Jul 29, 2003
196
US
All,
I'm trying to freshen up an existing Access DB wherein someone created a field called "date." Now, I would never do this myself, due to inherent problems like the one I'm now experiencing, but that's what was done.

When I was trying to call the 'date' function it kept referring to the 'date' field giving me odd results. So now I've renamed the field "logDate" to avoid the confusion, but the VBA code fails and tells me it couldn't find the 'date' field anywhere... I've copied the code (experimenting with "myVar=date" for right now) into another DB to confirm that it works and it does fine.

So, what do I need to do to dereference the 'date' field? Or, better yet, force VBA to recognize I'm calling the function, and not assume I'm looking for a field?

Xhonzi
 
You may try VBA.Date to get the function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I will try that, thank you. In this case, I was able to use the 'now' function in its place, but it's still ticking me off that I can't dereference that 'date' as a field name.
 
A little too late, but yes, the VBA.Date worked like a dream.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top