Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data change recording problem

Status
Not open for further replies.

kgerlitz

Technical User
Oct 2, 2004
84
0
0
US
I want to have the "APUpdated" field populate with the current date and time whenever a change is made to the record. Have used the code below with no success.

Private Sub Form_DataChange(ByVal Reason As Long)
[APUpdated] = Now()
End Sub

When I use this code in the BeforeUpdate it works but it also records the date and time even when I enter the record and leave without making data changes--not exactly what I want.

Any suggesstions

 
The form_beforeupdate event is the correct event. This event only fires if the data on the form has been changed. It does not fire if you only view the record.

The datachange event fires for certain changes if your form is a pivot table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top