Adding user name to records modified in Access

J

Jakki

How would I add a user name or initials to records added, deleted or edited
in an Access database? I can record the date and time but I will need to know
which user modified records.

Thanking you in advance,
 
B

Barry Gilbert

It depends on whether or not you are using Access security or not. If you
are, the CurrentUser() function will get the user logged in. If you aren't,
you can pick up the user who is logged into Windows with:
Environ("USERNAME")

Barry
 
D

Douglas J. Steele

I always cringe when people suggest using an environment variable for this
purpose, given how easy it is to reset an environment variable.

Far safer, in my opinion, is to use the GetUserName API call. See
http://www.mvps.org/access/api/api0008.htm at "The Access Web" for a
complete sample.
 
Top