Ambiguous Name Detected error

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
 
S

Software-Matters via AccessMonster.com

Hi,
This behavior occurs when multiple procedures with the same name are in a
module.. Look down the whole page of code for the form and I'm sure you will
find 2 instances of cmdfrmIBCCPReferrals_Click. if so delete 1.
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top