Automatic Date Entry

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.
 
O

Outpost

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()
 
J

John Vinson

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
 
Top