Current Date question

PRodgers4284

Registered User.
Local time
Today, 18:08
Joined
Feb 17, 2009
Messages
64
How do i format this date:

Me.date = Now()

To display only the date, not time etc
 
Last edited:
Firstly Date is a reserved word in Access so it's not a good idea to use it as a name for a field in a table or a control on a form. It just adds to possible confusion.

Me in a form/report module refers to the the current form/report.

Is your form bound to a table? Are you creating a new record or updating an existing record?
 
instead of now() try using Date()
 
To test it put an unbound text box on a form name it txtMyDate and then put this in the control source
Code:
=Date()

now when you open the form today's date will appear. You can change the format by using the format property of the unbound text box.

If the control is bound, make sure that the "Data Type" is "Date/Time" then you can put Date() in as the default value in the source table.

Hope this helps
 
Rabbie i have changed the textbox name form date to datecompleted, i am adding a new recoird to the table, i want fill the date textbox in by default when a user adds a new record. Paul i have tried date() but it doesnt work, my code for this is currently:

Me.DateCompleted = Now()

Is there any why i can format the "Now()" function to a short date?
 
Rabbie i have changed the textbox name form date to datecompleted. Paul i have tried date() but it doesnt work, my code for this is currently:

Me.DateCompleted = Now()

Is there any why i can format the "Now()" function to a short date?
Just format it as you would format any other date.

The only difference between Now() and Date() is that Now includes the current time. Date just gives you the date with time set to 12:00 am(Midnight)
 

Users who are viewing this thread

Back
Top Bottom