Date/time record modified

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a column that will timestamp/datestamp changes to any
record in my table. I cannot figure out how to do it in a Microsoft Access
Project. My goal is to be able to view any changes or additions to my table
during the previous few days or hours.

Cory
 
You need to put logic in the BeforeUpdate event of each form to add the
current timestamp to your LasterUpdated field.
 
I agree w/Alex. A trigger is the way to go. This works very well for me.

Use something like this in an update trigger.

IF UPDATE(NPLastUpdateby) OR UPDATE(NPLastUpdateDate) RETURN

--Update the table to show who the last update was made by and when to show
on the form
UPDATE p
SET NPLastUpdateBy=@strCurrentUser, NPLastUpdateDate=GETDATE()
FROM NP_Products p JOIN inserted i ON p.NPProductID=i.NPProductID

HTH,
Jim
 
Back
Top