If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date function problem
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 |
#2
|
|||
|
|||
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 "Alan Ibbotson" wrote in message ... 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 |
#3
|
|||
|
|||
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. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Alan Ibbotson" wrote in message ... 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 |
#4
|
|||
|
|||
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 "Douglas J. Steele" wrote in message ... 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. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Alan Ibbotson" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Having trouble with multi-select list box in Access | brandelfly | New Users | 4 | February 10th, 2005 08:36 PM |
Date Problem Help Needed, Please | Dave Elliott | Using Forms | 14 | October 30th, 2004 02:49 AM |
Excel: Add a function to retrieve the last Save Date. | prbonilla | Worksheet Functions | 1 | September 24th, 2004 06:17 PM |
QDE (Quick Date Entry) | Norman Harker | General Discussion | 3 | September 3rd, 2004 08:00 AM |
Date Function Problem | RCampbell | Worksheet Functions | 2 | February 2nd, 2004 02:18 AM |