Record modification dates & who did it

Kila

Registered User.
Local time
Today, 15:18
Joined
Mar 5, 2003
Messages
275
We have a database that we are sharing on a network How can I set up a table (or other method) that will automatically log when the database was last updated and who did it (the username). I would like to be able to run a report based on the modification dates of a particular user. Thanks in advance!
 
Add two new fields to the table [ModifiedBy & ModifiedDate]. In the forms Before Update event you need to set the value for those two fields to = Environ("UserName") and = Now(). If you are using Access security then you could use = CurrentUser instead.
 
The next big step would be to incorporate an Audit Trail into your db. Check out the sample I have posted @ Audit Trail.
 
Last edited:
Thanks!

That 1st part worked great! How can I get it to put in my username instead of Admin? I will try the Audit Trail later, after I finish a few other things with the database. Probably next week or so.
 
The function I posted above Environ("UserName") will get their network name.
 
Just an added note FYI,
I never did resolve my issues with Environ("UserName"). I believe it had to do with a malfunction in the install of Access itself. ghudson is correct in that it does pick up the network log on name when it works. In any event, check this thread for an alternative to using it:

http://www.access-programmers.co.uk/forums/showthread.php?t=88348
 
Last edited:
Using
= Environ("UserName")

instead of
= CurrentUser

worked great! Thanks!
 

Users who are viewing this thread

Back
Top Bottom