D
Douglas J. Steele
So you're saying that the DateModified and TimeModified fields are being
updated (why are you storing them in separate fields, btw? You should have a
single field and populate it using the Now function), but that Operator
isn't? That makes no sense.
For debugging purposes, try the following:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err
MsgBox "Before: Operator " & Me.Operator & vbCrLf & _
"(" & Me.DateModified & " " & Me.TimeModified & ")" & vbCrLf & _
"fOSUserName = " & fOSUserName()
' Set bound controls to system date and time and current user name.
Me.DateModified = Date
Me.TimeModified = Time()
Me.Operator = fOSUserName()
MsgBox "After: Operator " & Me.Operator & vbCrLf & _
"(" & Me.DateModified & " " & Me.TimeModified & ")"
BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub
updated (why are you storing them in separate fields, btw? You should have a
single field and populate it using the Now function), but that Operator
isn't? That makes no sense.
For debugging purposes, try the following:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err
MsgBox "Before: Operator " & Me.Operator & vbCrLf & _
"(" & Me.DateModified & " " & Me.TimeModified & ")" & vbCrLf & _
"fOSUserName = " & fOSUserName()
' Set bound controls to system date and time and current user name.
Me.DateModified = Date
Me.TimeModified = Time()
Me.Operator = fOSUserName()
MsgBox "After: Operator " & Me.Operator & vbCrLf & _
"(" & Me.DateModified & " " & Me.TimeModified & ")"
BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub