Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

users

Status
Not open for further replies.

megatron7

Programmer
Apr 18, 2005
11
0
0
US
is there a way to find out who has last opened or modified an Access file?
 
I don't know if access has a built in logging function, but I created a log of my own to track user activity.

I created a table that would store the user name, action (Modified, deleted, or added), what table the acted on, which record was affected, and when they did it.

see this thread on how to capture the user name.

For the "ON Dirty" function of a form I placed the following:

UserID = Environ("userName")
action = "Modified Record"
tableName = Me.Name
recNumber = Me.year & "-" & Me.mdr_no
ChangeLog

I used similar code for the Form Delete action and I have buttons on each form to added a new record to which I added the above lines of code.

ChangeLog is a public function that actualy writes to the LOG table

DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO LOG([user],[action],
,[record],[time]) VALUES ('" & UserID & "','" & action & "','" & tableName & "','" & recNumber & "','" & Now() & "')"
DoCmd.SetWarnings True

You need to use the DoCmd.Setwarnings command to keep the project form asking the user if they want to append the log file.

I hope that isn't too confusing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top