Automatic Date Entry

  • Thread starter Thread starter Colin Hammond
  • Start date Start date
C

Colin Hammond

I want to record the date that an entry is made, or updated, in one of the
fields of an access 97 database.
 
you can set Default value of the field to Date()
hope this could help you
 
Colin Hammond said:
I want to record the date that an entry is made, or updated, in one of the
fields of an access 97 database.


Create a new field in table, set Default Value to DATE()
 
I want to record the date that an entry is made, or updated, in one of the
fields of an access 97 database.

Date created is easy - as suggested elsethread, set the date/time
field's Default value to Date() (or to Now() if you want the exact
date and time).

Date *updated* is trickier. YOu must ensure that all data modification
is done using a Form; table datasheets don't have any usable events.
In the Form's BeforeUpdate event put code like

Private Sub Form_BeforeUpdate(Cancel as Integer)
<put any validation code here>
Me!txtTimestamp = Now() ' or Date() as above
End Sub

where txtTimestamp is a textbox bound to your date/time field.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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