Hi all,
I have a form which is also build with a subform. In the form I add the date and time when a record is changed/added to a respective table in the database. So that, when the next administrator logs in he/she can see when the form was last updated.
I used the following code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err
' Set bound controls to system date and time.
DateModified = Date
TimeModified = Time()
BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub
This works successfully, and imports the date and time when a record has been last modified or added.
The problem I am faced with is that, whenever I change data within the subform, the date and time is not updated to reflect to the change i.e., date and time is not affected with any changes to the subform amendments. How can I rectify this?
Thank you very much indeed
I have a form which is also build with a subform. In the form I add the date and time when a record is changed/added to a respective table in the database. So that, when the next administrator logs in he/she can see when the form was last updated.
I used the following code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err
' Set bound controls to system date and time.
DateModified = Date
TimeModified = Time()
BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub
This works successfully, and imports the date and time when a record has been last modified or added.
The problem I am faced with is that, whenever I change data within the subform, the date and time is not updated to reflect to the change i.e., date and time is not affected with any changes to the subform amendments. How can I rectify this?
Thank you very much indeed