Greetings,
I’ve designed a database consists of a main form and a subform based on tblHeadOfHouseHold and tblApplicants. I’ve also created an audit trial to track down the user name who last modified the record.
It works fine in the main form (frmHeadOfHouseHold) and updates the last user name who made changes to that record. But, if you make changes in the subform it doesn't update record changes to the main form.
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
I’ve designed a database consists of a main form and a subform based on tblHeadOfHouseHold and tblApplicants. I’ve also created an audit trial to track down the user name who last modified the record.
It works fine in the main form (frmHeadOfHouseHold) and updates the last user name who made changes to that record. But, if you make changes in the subform it doesn't update record changes to the main form.
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