Now() Function Help

  • Thread starter Thread starter steviebiddles
  • Start date Start date
S

steviebiddles

Guest
I use the now() function on a button in a form to write the date back to a table. However it writes the entire date and time back to the table like this...

08/02/2005 15:24:40

I want it to write only the date like this...

08/02/2005

How do i code this in my button???

I would be greatful for any help i can get.
 
Date fields always have a date part and a time part.

If you use the Now() function you get it to the second.
If you use the Date() function you get the date but you also get a time. The time you get is midnight. i.e. 01/05/05 00:00:00
 
I have tried that

For some reason when i type Date() ms access just remove the () and i cant do nothing to stop it.
 
For some reason when i type Date() ms access just remove the () and i cant do nothing to stop it.

It will do that in VBA. To force a displayed format you want you can do this with the Date() function....

Code:
Format(Date,"mm/dd/yyyy")

Date is one of many reserved words and should never be used to name a db object [field, control, text box, etc.].
 

Users who are viewing this thread

Back
Top Bottom