Auto Populate a static date

J

Jim

Hello,

I'm currently using =Now() to auto populate a form. Although it adjusts
based on the moment even with datasheet view.

How can I auto populate a date and time that will not change from teh moment
the form is submitted?

Thanks
 
J

Jeff Boyce

Jim

I'm not clear on what your requirement is...

If you use =Now() as a Default Value in a control in a form, any new record
added via that form will insert the date/time that the new record was first
started. Once the value is in the record, it doesn't change.

Are you saying that your form displays the same date/time value always?
Perhaps the control is not bound to any underlying field in a table then.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

You should have a field in a table to store the value and set the field's
default to Now().

This will Automatically store the date and time when the record was initiated
(the first key stroke or action that puts data into a bound control on a form
or into a field in a datasheet view of a table).

If you wish to store the datetime when the data from a form is first saved,
then you will need code in the form's after insert event to populate the field
in the table or in the before update event of the form that will check if the
field has a value and if not populate it with a date and time using the Now()
function.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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