Update a record

Danny

Registered User.
Local time
Today, 03:33
Joined
Jul 31, 2002
Messages
157
I’ve designed a database consists of a main form and a sub form. I’ve also created an audit trial, to track down the user name who last modified the record. It works fine in record was modified in the main form but in the subform, it only works on one control. Following is the code I used:

-----********************----
Option Compare Database
Private Function ModifiedInfo()
On Error GoTo ERROR_HANDLER

[LastModifiedBy].Value = Forms![frmMain]!lblUser.Caption
[TimeModified].Value = TimeValue(Now())
[DateModified].Value = DateValue(Now())

Exit Function
ERROR_HANDLER:
MsgBox (Err.NUMBER & vbCrLf & Err.Description)
Resume Next
End Function

----*******************----

Thanks,
DD
 
Move this to sample...

I guess you can put your code in the sample folder. Good Job. I did something similar but my code pulls user from the system.

Good Job.
 

Users who are viewing this thread

Back
Top Bottom