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!

Capture username and date for edits/updates

Status
Not open for further replies.

Introfield

Instructor
Apr 19, 2002
21
0
0
IT
Now I have multiple users I'd like to capture their level of activity. Is there a way to collect username and date for each time a form is opened/updated or similar? I just want to compare the total number of records changed on a daily basis (so time is unimportant).
Jax
Introfield
 
You can create a table to hold the information and then use the events of a form to trigger insertion of records. From what you describe, you could add code to the On Open, Before (or After) Update, etc.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks Duane for your response.
Could you elaborate on your suggestion of... "then use the events of a form to trigger insertion of records." ?
 
I don't know if you are familiar at all with code and/or form events. A simple introduction is to open a new, blank form in design view. View the event properties of the form and select the On Open event (click the ellipsis [...] button). Select "Code Builder" and you will be placed in a module window with the following code.
[Blue]
Code:
Private Sub Form_Open(Cancel As Integer)

End Sub
[/blue]
Add the following code line in the middle:
[Blue]
Code:
Private Sub Form_Open(Cancel As Integer)
    MsgBox "The form just opened at " & Format(Now,"mm/dd/yyyy hh:nn")
End Sub
[/blue]
All of the other form events work about the same. You can add code to do about anything you want.

To get the current user's login, there is code in the API section of
Come on back with specific questions.


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top