Time stamp data in Access

G

Guest

Does anyone know how to create a time stamp in a field when another field has
received data?
I'm scanning information into a database, but want to have a time stamp
linked to each scan. Is there a simple way to do this? Or will it involve
writing a macro?
 
G

Guest

How are you adding records? If you are using an append query, then just add a
date-formatted field to the table and update it to Date() in the append
query. This will put the datetime stamp into the field at the time the record
is appended.
 
J

John Vinson

Does anyone know how to create a time stamp in a field when another field has
received data?
I'm scanning information into a database, but want to have a time stamp
linked to each scan. Is there a simple way to do this? Or will it involve
writing a macro?

It will involve writing VBA code - I don't think macros will do it
(and they're very limited in any case).

But... it's easy code.

How are you doing the scanning? A barcode scanner into a textbox? If
so, put code in the AfterUpdate event of the textbox. Open the Form in
design view; select the control; view its properties; click the ...
icon by the AfterUpdate event on the Events tab; select Code Builder.
Access will give you the Sub and End Sub lines, you just need to add
one more:

Private Sub controlname_AfterUpdate()
Me.txtTimestamp = Now
End Sub

Use the name of the form control bound to your timestamp field in
place of txtTimestamp.

John W. Vinson[MVP]
 

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