Date/time record modified

C

Cory Bemis

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
 
D

Douglas J. Steele

You need to put logic in the BeforeUpdate event of each form to add the
current timestamp to your LasterUpdated field.
 
J

J. Clay

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top