Hi,
I have a table that I want to add two more fields to collect the update information whenever a record is updated. The two addition fields namely, date_modify with datatype= datetime and modified_by with datatype = number
I have added the following code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Update the record?", vbYesNo) = vbNo Then
Me.Undo
Else
date_modify = Now
modified_by = 123
End If
End Sub
I don't know what's wrong, if I only update the field date_modify, it looks like working fine. But if I tried to update the modified_by too, it doesn't work. It didn't updated and couldn't move to next record. It seems something wrong with the line modified_by = 123.
I have a table that I want to add two more fields to collect the update information whenever a record is updated. The two addition fields namely, date_modify with datatype= datetime and modified_by with datatype = number
I have added the following code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Update the record?", vbYesNo) = vbNo Then
Me.Undo
Else
date_modify = Now
modified_by = 123
End If
End Sub
I don't know what's wrong, if I only update the field date_modify, it looks like working fine. But if I tried to update the modified_by too, it doesn't work. It didn't updated and couldn't move to next record. It seems something wrong with the line modified_by = 123.