G
Guest
I have a private sub based on an ‘OnDirty’ event. The event creates a record
in an audit log. Here is the code:
Private Sub cmbBusClass_Dirty(Cancel As Integer)
userID = fOSUserName()
FormUsed = Me.Name
ChangeDesc = "Changed Business Class"
RecordNum = Me.RecordID
OrigVal = Me.cmbBusClass
strSQL = "INSERT INTO
tAuditLog(txtNTName,lngRecordID,txtChange,txtForm,dtmDate,dtmTime,txtOrigVal)
" & _
"VALUES ('" & userID & "','" & RecordNum & "','" & ChangeDesc & "','" &
FormUsed & "','" & Date & "','" & Time & "','" & OrigVal & "')"
DoCmd.RunSQL strSQL
End Sub
I want to declare OrigVal as the name of the control, without using the
control name. This type of sub will run on ten different forms, along with
OnError events that will append a 0 if the OrigVal is null.
Is there a way to do this?
Thanks in advance!
PJ
in an audit log. Here is the code:
Private Sub cmbBusClass_Dirty(Cancel As Integer)
userID = fOSUserName()
FormUsed = Me.Name
ChangeDesc = "Changed Business Class"
RecordNum = Me.RecordID
OrigVal = Me.cmbBusClass
strSQL = "INSERT INTO
tAuditLog(txtNTName,lngRecordID,txtChange,txtForm,dtmDate,dtmTime,txtOrigVal)
" & _
"VALUES ('" & userID & "','" & RecordNum & "','" & ChangeDesc & "','" &
FormUsed & "','" & Date & "','" & Time & "','" & OrigVal & "')"
DoCmd.RunSQL strSQL
End Sub
I want to declare OrigVal as the name of the control, without using the
control name. This type of sub will run on ten different forms, along with
OnError events that will append a 0 if the OrigVal is null.
Is there a way to do this?
Thanks in advance!
PJ