I need quick help with date function

A

Al

I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib. It
looks ok to me. any idea? please help.
thanks
Al
 
A

Art

Hi Al,
I had the same problem a while back. The Date
function just dropped dead in that module and nothing I
did could coax it back to life. I suggest using Now()
(assuming you cannot move the code to a new module, or
doing so does not solve the problem)and then parsing the
date.

The Easy Day
 
A

Al

Yes it worked? this is strange. did you ever know why?
The same line of code works in other forms and tables.
only this one form here. could it be corruption in the
form or table?
thanks
Al
-----Original Message-----
Hi Al,
I had the same problem a while back. The Date
function just dropped dead in that module and nothing I
did could coax it back to life. I suggest using Now()
(assuming you cannot move the code to a new module, or
doing so does not solve the problem)and then parsing the
date.

The Easy Day
-----Original Message-----
I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib. It
looks ok to me. any idea? please help.
thanks
Al
.
.
 
A

Art

Nope. Never found out why Date() would not work. Haven't
had the problem since. Just one of those Access mysteries
that cause us to lose hair and grind our teeth in our
sleep.

The Easy Day
-----Original Message-----
Yes it worked? this is strange. did you ever know why?
The same line of code works in other forms and tables.
only this one form here. could it be corruption in the
form or table?
thanks
Al
-----Original Message-----
Hi Al,
I had the same problem a while back. The Date
function just dropped dead in that module and nothing I
did could coax it back to life. I suggest using Now()
(assuming you cannot move the code to a new module, or
doing so does not solve the problem)and then parsing the
date.

The Easy Day
-----Original Message-----
I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib. It
looks ok to me. any idea? please help.
thanks
Al
.
.
.
 
J

Joe Marchione

HI,

I had the same problem and found out Access thought I was referring to a
field name.

Since that time I never use 'Date' as a field name. I always call it
something like 'eDate'.

Hope this helps solve the mystery.

--

JOE


Al said:
Yes it worked? this is strange. did you ever know why?
The same line of code works in other forms and tables.
only this one form here. could it be corruption in the
form or table?
thanks
Al
-----Original Message-----
Hi Al,
I had the same problem a while back. The Date
function just dropped dead in that module and nothing I
did could coax it back to life. I suggest using Now()
(assuming you cannot move the code to a new module, or
doing so does not solve the problem)and then parsing the
date.

The Easy Day
-----Original Message-----
I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib. It
looks ok to me. any idea? please help.
thanks
Al
.
.
 
M

Marshall Barton

Al said:
I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib.


If it's not a references issue (and it doesn't sound like it
is), then try checking if you have some variable, control or
field named Date in the module's name space.
 
A

Al

Yes you were right. that was the problem.
thanks
Al
-----Original Message-----
Al said:
I have the following code in the beforeupdate event of a
form:

Me![ModDate] = Date
Me![ModTime] = Time
Me![ModInitials] = CurrentUser()
The only line that does not work is the Me![ModDate] =
Date. It is showing null instead of today's date. when I
replaced it with the following "Me![ModDate] = Time" it
works and formats the time as Date. I do not understand
why it is not working. I even checked my reference lib.


If it's not a references issue (and it doesn't sound like it
is), then try checking if you have some variable, control or
field named Date in the module's name space.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top