What is wrong with my code?

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

in the BeforeUpdate event I have the following:

=SetUpCtl_Before(Me)

this calls the following

Public Function SetUpCtl_Before(frm As Form)
With frm
FldName = .ActiveControl.Name
fldVal = .ActiveControl.OldValue
End With
Call AuditLogBefore(FldName, fldVal)
End Function
When I try to change anything in the field that has the function I get the
following Error Message:
"The expression beforeupdate you entered as the event property setting
produced the following error: the object does not contain the automation
object 'Me.'"
I do not know what is the wrong with my code?
Please help
 
'Me' is only valid in VBA code. If you have SetUpCtl_Before(Me) as the
property of an event rather than in code attached to an event then you need to
use instead:

=SetUpCtl_Before(Form)

HTH
John
##################################
Don't Print - Save trees
 
Back
Top