MS Access Report Error Message

F

Fee

I am working with a MS Access Database created by someone else and
when I try to run an existing report,
I received this message. This was a working report. The coding for the
report is noted below the error message.


Microsoft Visual Basic Error Message:
Compile error: Ambiguous name detected:IntiToc

Can someone help me on what I need to do or look for to eliminate this
error?


Microsoft Access Database:
Option Compare Database
Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As
Integer)
Call UpdatePageNumber

End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As
Integer)
Call UpdateToc([SECT_NUM_NAME], Report)

End Sub

Private Sub Report_Open(Cancel As Integer)
Call InitToc

End Sub
 
J

John Spencer

Usually that means that there are two (or more) procedures named InitToc that
are within scope.

Do you have two InitToc procedures that are public?

Do you have two InitToc procedures that are in the current module?

If neither one of those applies, you may need to decompile the VBA code and
then recompile it.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
J

John W. Vinson

I am working with a MS Access Database created by someone else and
when I try to run an existing report,
I received this message. This was a working report. The coding for the
report is noted below the error message.


Microsoft Visual Basic Error Message:
Compile error: Ambiguous name detected:IntiToc

Can someone help me on what I need to do or look for to eliminate this
error?


Microsoft Access Database:
Option Compare Database
Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As
Integer)
Call UpdatePageNumber

End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As
Integer)
Call UpdateToc([SECT_NUM_NAME], Report)

End Sub

Private Sub Report_Open(Cancel As Integer)
Call InitToc

End Sub

It sounds like there are TWO lines in your code somewhere saying

Public Sub InitToc

(or possibly IntiToc, depending on which line in your post had the typo).

Open the VBA editor, click the binoculars icon, select "current project" to
search all your code, and search for the name in the error message. The error
is saying that there are two of them - if there are two identical routines
just delete one, if there are two different ones find out which one is correct
(which may not be easy!)
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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