time stamp in table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i get a table to insert a date in the date field corresponding to the
date when record is created.
eg when a person creates a record, i want the current date to automatically
insert on the table.
a simple as poss please, examples would be grateful!
 
Normally this is done via a form using the update event as the trigger.
For it to work you need to force the users to use the form or forms.
 
how?

Joseph Meehan said:
Normally this is done via a form using the update event as the trigger.
For it to work you need to force the users to use the form or forms.
 
If you are interested only in the date the record was inserted, and don't
want it to change when existing records are modified, you can simply set the
Default Value property of the field in table design view to =Date(), or
=Now() if you want the time as well as the date. Otherwise, as Joseph
suggests elsewhere in this thread, you'll need to use forms. In the
AfterUpdate event procedure of the form, you need a single line of code ...

Me.NameOfField = Date()

The field does not have to be displayed on the form unless you want it to
be, but if the form is based on a query or SQL statement, the field must be
included in the SELECT clause.
 
garethhop22 said:

Bernard answered it well and added the idea of making it a default value
which would be even easier. I would have likely recommended that if I had
thought of it at the time. While there are advantages to each method, I
suspect that for your needs the default value would be best.
 

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

Back
Top