Please help!
I've done a search of the forums, the results of which have more-or-less caused me to understand (roughly) what the problem might be and how to locate the code which is causing it. Sadly, I am a bit of a Visual Basic virgin, and I am reluctant to wade right in because if I screw up this database I'll have decimated my company's advertising and marketing strategy (mailouts!).
I was trying to make a command button on a switchboard (which I have done before, but not recently) -- and was taking a bit of a trial-and-error approach. I wanted the button to result in the previewing of a set of mailing labels (which the user would susbsequently print after reviewing). One of my first attempts resulted in the button automatically printing, so I "cut" it, and several close-but-no-cigar attempts follwed, all of which I used the "cut" command to dispose of. The last attempt I made resulted in the following message:
"The expression On Open you entered as the event property setting produced the following error: Ambiguous name detected: Bulletin_Board_labels_Click.
-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."
I "cut" the button I had just created and thought that might fix it. It didn't. I still got the above message whenever I tried to open either this switchboard or the main switchboard. I tried closing down Access and restarting it. Same message, same problem.
Below is the code from the switchboard in question -- the last few entries are the relevant ones: anything to do with "bulletin board" is stuff I was working on. As far as I can tell there are currently no duplicate queries, reports, macros, etc, named "Bulletin Board Labels" (theres is one query named "Bulletin Board Query", and one report named "Bulletin Board Mailout labels", and that's it.)
The code for the switchboard follows...
Please help me resolve this problem?
Jennifer
_________________________________________
Option Compare Database
Option Explicit
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "All Art Galleries"
DoCmd.OpenReport stDocName, acPreview
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Command11_Click()
End Sub
Private Sub OLEUnbound22_Click()
Dim strInput As String
strInput = "help.html"
Application.FollowHyperlink strInput, , True
End Sub
Private Sub University_Bigwigs_Click()
On Error GoTo Err_University_Bigwigs_Click
Dim stDocName As String
stDocName = "University Bigwigs Query (VP's, Deans, etc)"
DoCmd.OpenReport stDocName, acPreview
Exit_University_Bigwigs_Click:
Exit Sub
Err_University_Bigwigs_Click:
MsgBox Err.Description
Resume Exit_University_Bigwigs_Click
End Sub
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
stDocName = "Invitation Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
Private Sub Main_Click()
On Error GoTo Err_Main_Click
DoCmd.Close
Exit_Main_Click:
Exit Sub
Err_Main_Click:
MsgBox Err.Description
Resume Exit_Main_Click
End Sub
Private Sub Help__Click()
On Error GoTo Err_Help__Click
Dim stAppName As String
stAppName = "C:\AEAC Mailing list Database\help.html"
Call Shell(stAppName, 1)
Exit_Help__Click:
Exit Sub
Err_Help__Click:
MsgBox Err.Description
Resume Exit_Help__Click
End Sub
Private Sub Ref_List_Click()
On Error GoTo Err_Ref_List_Click
Dim stDocName As String
stDocName = "Category/Destination/Receive"
DoCmd.OpenReport stDocName, acPreview
Exit_Ref_List_Click:
Exit Sub
Err_Ref_List_Click:
MsgBox Err.Description
Resume Exit_Ref_List_Click
End Sub
Private Sub Campus_Coverage_Click()
On Error GoTo Err_Campus_Coverage_Click
Dim stDocName As String
stDocName = "Campus Coverage Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Campus_Coverage_Click:
Exit Sub
Err_Campus_Coverage_Click:
MsgBox Err.Description
Resume Exit_Campus_Coverage_Click
End Sub
Private Sub Flyer_Report_Click()
On Error GoTo Err_Flyer_Report_Click
Dim stDocName As String
stDocName = "Flyer Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Flyer_Report_Click:
Exit Sub
Err_Flyer_Report_Click:
MsgBox Err.Description
Resume Exit_Flyer_Report_Click
End Sub
Private Sub Poster_Destination_List_Click()
On Error GoTo Err_Poster_Destination_List_Click
Dim stDocName As String
stDocName = "Poster Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Poster_Destination_List_Click:
Exit Sub
Err_Poster_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Poster_Destination_List_Click
End Sub
Private Sub Currents_Destination_List_Click()
On Error GoTo Err_Currents_Destination_List_Click
Dim stDocName As String
stDocName = "Currents Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Currents_Destination_List_Click:
Exit Sub
Err_Currents_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Currents_Destination_List_Click
End Sub
Private Sub Catalogue_Destination_Click()
On Error GoTo Err_Catalogue_Destination_Click
Dim stDocName As String
stDocName = "Catalogue Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Catalogue_Destination_Click:
Exit Sub
Err_Catalogue_Destination_Click:
MsgBox Err.Description
Resume Exit_Catalogue_Destination_Click
End Sub
Private Sub FlyerMultCopiesButton_Click()
On Error GoTo Err_FlyerMultCopiesButton_Click
Dim stDocName As String
stDocName = "Flyer Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_FlyerMultCopiesButton_Click:
Exit Sub
Err_FlyerMultCopiesButton_Click:
MsgBox Err.Description
Resume Exit_FlyerMultCopiesButton_Click
End Sub
Private Sub InvitatMultCopButton_Click()
On Error GoTo Err_InvitatMultCopButton_Click
Dim stDocName As String
stDocName = "Invitation Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_InvitatMultCopButton_Click:
Exit Sub
Err_InvitatMultCopButton_Click:
MsgBox Err.Description
Resume Exit_InvitatMultCopButton_Click
End Sub
Private Sub CampFlyMultCopButton_Click()
On Error GoTo Err_CampFlyMultCopButton_Click
Dim stDocName As String
stDocName = "Campus Flyer Multiple Copies Query"
DoCmd.OpenReport stDocName, acPreview
Exit_CampFlyMultCopButton_Click:
Exit Sub
Err_CampFlyMultCopButton_Click:
MsgBox Err.Description
Resume Exit_CampFlyMultCopButton_Click
End Sub
Private Sub PostMultCopButton_Click()
On Error GoTo Err_PostMultCopButton_Click
Dim stDocName As String
stDocName = "Poster Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_PostMultCopButton_Click:
Exit Sub
Err_PostMultCopButton_Click:
MsgBox Err.Description
Resume Exit_PostMultCopButton_Click
End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acNormal
Exit_Bulletin_Board_labels_Click:
Exit Sub
Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click
End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview
Exit_Bulletin_Board_labels_Click:
Exit Sub
Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click
End Sub
Private Sub Command57_Click()
On Error GoTo Err_Command57_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command57_Click:
Exit Sub
Err_Command57_Click:
MsgBox Err.Description
Resume Exit_Command57_Click
End Sub
Private Sub Command58_Click()
On Error GoTo Err_Command58_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview
Exit_Command58_Click:
Exit Sub
Err_Command58_Click:
MsgBox Err.Description
Resume Exit_Command58_Click
End Sub
I've done a search of the forums, the results of which have more-or-less caused me to understand (roughly) what the problem might be and how to locate the code which is causing it. Sadly, I am a bit of a Visual Basic virgin, and I am reluctant to wade right in because if I screw up this database I'll have decimated my company's advertising and marketing strategy (mailouts!).
I was trying to make a command button on a switchboard (which I have done before, but not recently) -- and was taking a bit of a trial-and-error approach. I wanted the button to result in the previewing of a set of mailing labels (which the user would susbsequently print after reviewing). One of my first attempts resulted in the button automatically printing, so I "cut" it, and several close-but-no-cigar attempts follwed, all of which I used the "cut" command to dispose of. The last attempt I made resulted in the following message:
"The expression On Open you entered as the event property setting produced the following error: Ambiguous name detected: Bulletin_Board_labels_Click.
-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."
I "cut" the button I had just created and thought that might fix it. It didn't. I still got the above message whenever I tried to open either this switchboard or the main switchboard. I tried closing down Access and restarting it. Same message, same problem.
Below is the code from the switchboard in question -- the last few entries are the relevant ones: anything to do with "bulletin board" is stuff I was working on. As far as I can tell there are currently no duplicate queries, reports, macros, etc, named "Bulletin Board Labels" (theres is one query named "Bulletin Board Query", and one report named "Bulletin Board Mailout labels", and that's it.)
The code for the switchboard follows...
Please help me resolve this problem?

Jennifer
_________________________________________
Option Compare Database
Option Explicit
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "All Art Galleries"
DoCmd.OpenReport stDocName, acPreview
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Command11_Click()
End Sub
Private Sub OLEUnbound22_Click()
Dim strInput As String
strInput = "help.html"
Application.FollowHyperlink strInput, , True
End Sub
Private Sub University_Bigwigs_Click()
On Error GoTo Err_University_Bigwigs_Click
Dim stDocName As String
stDocName = "University Bigwigs Query (VP's, Deans, etc)"
DoCmd.OpenReport stDocName, acPreview
Exit_University_Bigwigs_Click:
Exit Sub
Err_University_Bigwigs_Click:
MsgBox Err.Description
Resume Exit_University_Bigwigs_Click
End Sub
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
stDocName = "Invitation Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
Private Sub Main_Click()
On Error GoTo Err_Main_Click
DoCmd.Close
Exit_Main_Click:
Exit Sub
Err_Main_Click:
MsgBox Err.Description
Resume Exit_Main_Click
End Sub
Private Sub Help__Click()
On Error GoTo Err_Help__Click
Dim stAppName As String
stAppName = "C:\AEAC Mailing list Database\help.html"
Call Shell(stAppName, 1)
Exit_Help__Click:
Exit Sub
Err_Help__Click:
MsgBox Err.Description
Resume Exit_Help__Click
End Sub
Private Sub Ref_List_Click()
On Error GoTo Err_Ref_List_Click
Dim stDocName As String
stDocName = "Category/Destination/Receive"
DoCmd.OpenReport stDocName, acPreview
Exit_Ref_List_Click:
Exit Sub
Err_Ref_List_Click:
MsgBox Err.Description
Resume Exit_Ref_List_Click
End Sub
Private Sub Campus_Coverage_Click()
On Error GoTo Err_Campus_Coverage_Click
Dim stDocName As String
stDocName = "Campus Coverage Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Campus_Coverage_Click:
Exit Sub
Err_Campus_Coverage_Click:
MsgBox Err.Description
Resume Exit_Campus_Coverage_Click
End Sub
Private Sub Flyer_Report_Click()
On Error GoTo Err_Flyer_Report_Click
Dim stDocName As String
stDocName = "Flyer Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Flyer_Report_Click:
Exit Sub
Err_Flyer_Report_Click:
MsgBox Err.Description
Resume Exit_Flyer_Report_Click
End Sub
Private Sub Poster_Destination_List_Click()
On Error GoTo Err_Poster_Destination_List_Click
Dim stDocName As String
stDocName = "Poster Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Poster_Destination_List_Click:
Exit Sub
Err_Poster_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Poster_Destination_List_Click
End Sub
Private Sub Currents_Destination_List_Click()
On Error GoTo Err_Currents_Destination_List_Click
Dim stDocName As String
stDocName = "Currents Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Currents_Destination_List_Click:
Exit Sub
Err_Currents_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Currents_Destination_List_Click
End Sub
Private Sub Catalogue_Destination_Click()
On Error GoTo Err_Catalogue_Destination_Click
Dim stDocName As String
stDocName = "Catalogue Destination Report"
DoCmd.OpenReport stDocName, acPreview
Exit_Catalogue_Destination_Click:
Exit Sub
Err_Catalogue_Destination_Click:
MsgBox Err.Description
Resume Exit_Catalogue_Destination_Click
End Sub
Private Sub FlyerMultCopiesButton_Click()
On Error GoTo Err_FlyerMultCopiesButton_Click
Dim stDocName As String
stDocName = "Flyer Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_FlyerMultCopiesButton_Click:
Exit Sub
Err_FlyerMultCopiesButton_Click:
MsgBox Err.Description
Resume Exit_FlyerMultCopiesButton_Click
End Sub
Private Sub InvitatMultCopButton_Click()
On Error GoTo Err_InvitatMultCopButton_Click
Dim stDocName As String
stDocName = "Invitation Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_InvitatMultCopButton_Click:
Exit Sub
Err_InvitatMultCopButton_Click:
MsgBox Err.Description
Resume Exit_InvitatMultCopButton_Click
End Sub
Private Sub CampFlyMultCopButton_Click()
On Error GoTo Err_CampFlyMultCopButton_Click
Dim stDocName As String
stDocName = "Campus Flyer Multiple Copies Query"
DoCmd.OpenReport stDocName, acPreview
Exit_CampFlyMultCopButton_Click:
Exit Sub
Err_CampFlyMultCopButton_Click:
MsgBox Err.Description
Resume Exit_CampFlyMultCopButton_Click
End Sub
Private Sub PostMultCopButton_Click()
On Error GoTo Err_PostMultCopButton_Click
Dim stDocName As String
stDocName = "Poster Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview
Exit_PostMultCopButton_Click:
Exit Sub
Err_PostMultCopButton_Click:
MsgBox Err.Description
Resume Exit_PostMultCopButton_Click
End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acNormal
Exit_Bulletin_Board_labels_Click:
Exit Sub
Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click
End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview
Exit_Bulletin_Board_labels_Click:
Exit Sub
Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click
End Sub
Private Sub Command57_Click()
On Error GoTo Err_Command57_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command57_Click:
Exit Sub
Err_Command57_Click:
MsgBox Err.Description
Resume Exit_Command57_Click
End Sub
Private Sub Command58_Click()
On Error GoTo Err_Command58_Click
Dim stDocName As String
stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview
Exit_Command58_Click:
Exit Sub
Err_Command58_Click:
MsgBox Err.Description
Resume Exit_Command58_Click
End Sub
Last edited: