Time Stamp

A

Adam

How can I automatically populate the current date into a field for a new
record? Will this automation apply a new date to all records?
 
D

Darrell Childress

Adam said:
How can I automatically populate the current date into a field for a new
record? Will this automation apply a new date to all records?

Set the default value to be Date(). This is done in the table design
view. You can, obviously, set the format in the field to show only date,
or date and time if you need to know the time of day the record was added.
 
L

Linq Adams via AccessMonster.com

Darrell's suggestion will work just fine, of course, but just so that you
know how to differentiate between new records and old records when doing
something like this, you could also have used

Private Sub Form_Current()
If Me.NewRecord Then
Me.TimeStamp = Date
End If
End Sub

and only the new records would have been effected, with the existing records
retaining their original creation timestamps.
 

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