Now () when adding (form), in a table NOW () must 'freeze'

janfolmer

Registered User.
Local time
Today, 09:17
Joined
Nov 30, 2005
Messages
24
When I add something in a table using a form, I always want an automatic date, namely today's date. So I set this in the form with NOW (). The only thing is, when I view my records a day later, it automatically adjusts the dates.

I don't want to type in the date every time, because it's always todays date. But I don't want the table to adjust the data-capturing dates automatically.

Any suggestions to get around this?
 
Use the default value property of the control in the form. This will only affect the field when you are adding a new record.

Date() will give you just the date. Only use Now() if you really want time and date.
 
Or you can default the Date field in your table as Date() then add a control on your form with its control source is your Date field and make the control's enabled to false. There won't need to enter anything. It will always be filled in with the current date.
 
Hi jan,

If your field is "when did I last change/create this record" then you will need some code in the BeforeUpdate event of the form:

Me.YourFieldName = Date
or
Me.YourFieldName = Now '-- If you also want the time.

...using YourFieldName of course.

The BeforeUpdate event of the form only fires when something on the record has been changed and needs to be saved.
 

Users who are viewing this thread

Back
Top Bottom