A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date function problem



 
 
Thread Tools Display Modes
  #1  
Old June 14th, 2005, 11:14 PM
Alan Ibbotson
external usenet poster
 
Posts: n/a
Default 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  
Old June 14th, 2005, 11:22 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default

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  
Old June 15th, 2005, 12:38 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

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  
Old June 15th, 2005, 04:25 AM
Alan Ibbotson
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.