Date function problem

  • Thread starter Thread starter Alan Ibbotson
  • Start date Start date
A

Alan Ibbotson

I am trying to return the current date.

Using VBA, in an event procedure I have:

MsgBox (Date), I have tried entering Date() but it reverts back to text
shown. When the code is executed I get an error that the "date field" can
not be found.

What's up with that? TIA
 
Alan

I just entered ?MsgBox(Date()) in the Immediate window and pressed enter --
I got 6/14/2005.

Perhaps if you provided a bit more context ... what code do you have this
embedded in?

Have you checked your References to see if any are marked MISSING?

Good luck

Jeff Boyce
<Access MVP>
 
Are you using Date for any other purposes in your application: the name of a
variable, the name of a field in a table, the name of a control on a form or
report, etc.? If so, rename it.

If not, then Jeff's suggestion of the checking the references is the next
thing to do.
 
Well, what I did do was have a field that was called "Date" without the
quotes, early on in my database. I soon realized that this was not a good
thing (this is my first database project) and I changed the field to
"TheDate". I did try the immediate window and it worked correctly for both
time and date. I just can't get it to work in the event procedure. Any
thoughts? I will check the references in the meantime. Thanks.

Alan
 
Back
Top