Ambiguous Name Detected error

  • Thread starter Thread starter zufie
  • Start date Start date
Z

zufie

I am trying to get my command button to open a Form rather than a
report.

I tried messing with the VBA behind the command button which gave me
the error:
Ambiguous Name Detected: cmdfrmIBCCPReferrals_Click.

Here is the ORIGINAL VBA:

Private Sub cmdrptIBCCPQualityAssuranceCOPYEvery5thReport_Click()
On Error GoTo Err_cmdrptIBCCPQualityAssuranceCOPYEvery5thReport_Click

Dim stDocName As String

MsgBox "Please wait while the system creates the report."

stDocName = "rptIBCCPQualityAssuranceCOPYEvery5thReport"
DoCmd.OpenReport stDocName, acPreview

Exit_cmdrptIBCCPQualityAssuranceCOPYEvery5thReport_Click:
Exit Sub

Err_cmdrptIBCCPQualityAssuranceCOPYEvery5thReport_Click:
MsgBox Err.Description
Resume Exit_cmdrptIBCCPQualityAssuranceCOPYEvery5thReport_Click

End Sub

===========================================================
Here is the VBA AFTER I messed with it:

Private Sub cmdformIBCCPQAEvery5thQuery_Click()
On Error GoTo Err_cmdformIBCCPQAEvery5thQuery_Click

Dim stDocName As String

MsgBox "Please wait while the system creates the report."

stDocName = "formIBCCPReferrals"
DoCmd.OpenFORM stDocName, acPreview

Exit_cmdformIBCCPQAEvery5thQuery_Click:
Exit Sub

Err_cmdformIBCCPQAEvery5thQuery_Click:
MsgBox Err.Description
Resume Exit_cmdformIBCCPQAEvery5thQuery_Click

End Sub
 
I tried messing with the VBA behind the command button which gave me
the error:
Ambiguous Name Detected: cmdfrmIBCCPReferrals_Click.

Use the binoculars icon in the VBA editor. Almost surely you have TWO
procedures of that name in your module. Delete the old one and you'll be OK.
 
Back
Top