R
Robert Blackwell
On a form, there is a checkbox to flag for bad addresses. When the record
loads a msg box popsup if the box is checked. I'm trying to duplicate it for
another similar function. So far, I can make the new checkbox and it works
fine. However, when I add the code to run the macro it ruins my whole form
so it will not even load.
Here's the code for the original check box
Private Sub ConAddressAlert_Click()
End Sub
Private Sub Form_Current()
If ConAddressAlert = True Then
DoCmd.RunMacro "mcrAddressAlert"
End If
End Sub
Here's what I've added for my new checkbox
Private Sub BadAccount_Click()
End Sub
Private Sub Form_Current()
If BadAccount = True Then
DoCmd.RunMacro "mcrBadAccunt"
End If
End Sub
If I delete my code section it works again.
When I add my code and try to run the form, I get 2 little windows titled
[Enter Parameter Value]
Forms!frmContacts!SearchName
TEXTBOX
[OK] [Cancel]
[Enter Parameter Value]
Forms!frmContacts!SearchBusiness
TEXTBOX
[OK] [Cancel]
Then anotherbox
[Company Contacts]
(i) The expression On Open you entered as the event property setting
produced the following error: Ambiguous name detected:Form_Current.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.
[OK]
loads a msg box popsup if the box is checked. I'm trying to duplicate it for
another similar function. So far, I can make the new checkbox and it works
fine. However, when I add the code to run the macro it ruins my whole form
so it will not even load.
Here's the code for the original check box
Private Sub ConAddressAlert_Click()
End Sub
Private Sub Form_Current()
If ConAddressAlert = True Then
DoCmd.RunMacro "mcrAddressAlert"
End If
End Sub
Here's what I've added for my new checkbox
Private Sub BadAccount_Click()
End Sub
Private Sub Form_Current()
If BadAccount = True Then
DoCmd.RunMacro "mcrBadAccunt"
End If
End Sub
If I delete my code section it works again.
When I add my code and try to run the form, I get 2 little windows titled
[Enter Parameter Value]
Forms!frmContacts!SearchName
TEXTBOX
[OK] [Cancel]
[Enter Parameter Value]
Forms!frmContacts!SearchBusiness
TEXTBOX
[OK] [Cancel]
Then anotherbox
[Company Contacts]
(i) The expression On Open you entered as the event property setting
produced the following error: Ambiguous name detected:Form_Current.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.
[OK]