AfterUpdate Now() to table

  • Thread starter Thread starter MeSteve
  • Start date Start date
M

MeSteve

I am using:
CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now()"
as suggested here, but it is updating ALL records, how do I specify the
record that was actully changed?
 
If you are talking about TimeStamping a record that was updated on a form
then you want your code in the BeforeUpdate event of the form. In this case
you do not need SQL but simply:
[DateUpdated] = Now
 
CurrentDb.Execute "UPDATE tbl_Projects SET DateUpdated = Now() " & _
"WHERE ID = " & Me.ID

(or whatever's necessary to uniquely identify the row)
 
Back
Top