A
AccessHelp
Hello all,
I have 3 combo boxes on a form. The users make changes to those combo boxes
sometimes.
What I like to do is I would like to write a code to run my macro on form
closes if the users make changes to any or all of those combo boxes. Below
is the code that I wrote and it's not working. Please help. Thanks.
Private Sub Form_Close()
On Error GoTo Err_Form_Close
Dim stDocName As String
If Me.A.ondirty _
or me.B.ondirty _
or me.C.ondirty then
stDocName = "mcrRun_Queries"
DoCmd.RunMacro stDocName
End If
Exit_Form_Close:
Exit Sub
Err_Form_Close:
MsgBox Err.Description
Resume Exit_Form_Close
End Sub
I have 3 combo boxes on a form. The users make changes to those combo boxes
sometimes.
What I like to do is I would like to write a code to run my macro on form
closes if the users make changes to any or all of those combo boxes. Below
is the code that I wrote and it's not working. Please help. Thanks.
Private Sub Form_Close()
On Error GoTo Err_Form_Close
Dim stDocName As String
If Me.A.ondirty _
or me.B.ondirty _
or me.C.ondirty then
stDocName = "mcrRun_Queries"
DoCmd.RunMacro stDocName
End If
Exit_Form_Close:
Exit Sub
Err_Form_Close:
MsgBox Err.Description
Resume Exit_Form_Close
End Sub