Change date after edit

  • Thread starter Thread starter Don James
  • Start date Start date
D

Don James

Hi
I have a table containing customer data such as name, address, city etc. My
"add customer" form also contains a "date entered" with a default DATE().
All of this works fine. I also have a "Edit Customer" form. What I would
like is a way for the "date entered" to automatically update ONLY if there
were changes made to any field in the record. Is there a way to do this?

Thanks
dj
 
I have a table containing customer data such as name, address, city etc. My
"add customer" form also contains a "date entered" with a default DATE().
All of this works fine. I also have a "Edit Customer" form. What I would
like is a way for the "date entered" to automatically update ONLY if there
were changes made to any field in the record. Is there a way to do this?

Move the update of your date field to the Form_BeforeUpdate event.

HTH - Peter
 
Add a "Date Modified" field to the table.

Use the following code in the form's BeforeUpdate event.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![Date Modified].Value = Date
End Sub

Con Giacomini
 
Back
Top