I have an audit log that records the values of a control before and after it
is changed. The first part of the process runs on an OnDirty event to record
the value before the change and the second part runs on an AfterUpdate event
(code below).
The OnDirty part works fine, but when I try to execute the code below, I am
prompted for a parameter value. There is identical code that runs on 15
other controls with no problem. The other updates are on dates and numbers.
One interesting thing to note is that if I enter a numeric charater instead
of a text character, the code runs fine.
I am running 2003 on XP.
Thoughts?
PJ
is changed. The first part of the process runs on an OnDirty event to record
the value before the change and the second part runs on an AfterUpdate event
(code below).
The OnDirty part works fine, but when I try to execute the code below, I am
prompted for a parameter value. There is identical code that runs on 15
other controls with no problem. The other updates are on dates and numbers.
One interesting thing to note is that if I enter a numeric charater instead
of a text character, the code runs fine.
Code:
Private Sub txtCompanyScreened_AfterUpdate()
Dim NewVal As String
[COLOR=green]'Set NewVal to be the new control value[/color]
NewVal = Me.txtCompanyScreened
strSQL = "UPDATE tAuditLogTxt SET txtNewVal=" & NewVal & _
" WHERE anID=(SELECT Max(anID) FROM tAuditLogTxt WHERE txtNTName='" &
fOSUserName() & "')"
DoCmd.RunSQL strSQL
End Sub
Thoughts?
PJ