A2003 on Win XP.
I have a bound form. On the table bound to the form, I have 2 fields: ChangedDate which stores the date the record was changed, and ChangeUser which stores the network username of the person who changed the record.
In my Form_BeforeUpdate event I put this code:
But I'm getting an Unknown Error each time I try to disable the field (which has the focus.)
Am I doing things right? Is the code in the correct event? How do I keep the 2 fields disabled after I update their bound contents?
Thanks.
I have a bound form. On the table bound to the form, I have 2 fields: ChangedDate which stores the date the record was changed, and ChangeUser which stores the network username of the person who changed the record.
In my Form_BeforeUpdate event I put this code:
Code:
On Error GoTo MyError
'DoCmd.RunCommand acCmdSaveRecord
txtUpdateDate.Enabled = True
txtUpdateUser.Enabled = True
txtUpdateDate = Now()
txtUpdateDate.Enabled = False
txtUpdateUser = gUsername
txtUpdateUser.Enabled = False
Exit Sub
MyError:
If (Err.Number <> 2046) And (Err.Number > 0) Then
Call DispError("Form_Dirty")
Stop
Resume Next
'Exit Sub
End If
Am I doing things right? Is the code in the correct event? How do I keep the 2 fields disabled after I update their bound contents?
Thanks.
Last edited: