arisythila
Technical User
Hello, Im new to the forums. I've read through a few of the posts, and decided to ask a question myself. Im in the middle of doing a database for a friend. He wants there to be a way if there is any changes made to a file, to input who did it, and when. So he can keep tract of the last person that made changes in a file. so far, I got pretty much everything setup, Im just having trouble with this code. Im pretty use to C, and that was back in the day.
I made an update button that updates the current file they are in, and I tried to add some code, that would say who the current user was, and try to write it to a field in the table. But no luck, here are some screenies.
Here is the code, I Wrote for the update button.
////--------------////
Private Sub SaveRecord_Click()
On Error GoTo Err_SaveRecord_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_SaveRecord_Click:
Exit Sub
Me.Updatedby = CurrentUser
Me.Updateddate = Date
Err_SaveRecord_Click:
MsgBox Err.Description
Resume Exit_SaveRecord_Click
End Sub
////----------////
Please let me know if you have any suggestions. I could really use the help.
~Michael
I made an update button that updates the current file they are in, and I tried to add some code, that would say who the current user was, and try to write it to a field in the table. But no luck, here are some screenies.
Here is the code, I Wrote for the update button.
////--------------////
Private Sub SaveRecord_Click()
On Error GoTo Err_SaveRecord_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_SaveRecord_Click:
Exit Sub
Me.Updatedby = CurrentUser
Me.Updateddate = Date
Err_SaveRecord_Click:
MsgBox Err.Description
Resume Exit_SaveRecord_Click
End Sub
////----------////
Please let me know if you have any suggestions. I could really use the help.
~Michael