Access 2003 Error: Visual Basic Error - Ambiguous Name detected

G

Guest

I created a "command" button on a form, which performs a Form Operation of
opening another form. Using the wizard, I selected the type of operation and
the action perform. Next I select the form I want to open. When the form
opens, I chose to display all records.

Using the new button created on the form, I click the button an get the
following error: [Microsoft Visal Basic] Compile Error: Ambiguous name
detected: Find_Record_Click.

The error message opens the VB screen and displays various lines of code
(which I don't know how to read).

Is there an easy fix from Microsoft? I am using the standard features (not
writing my own VB code.)
 
J

Jeff Conrad

Hi,

This is a classic example of Access not cleaning up after
itself. When you delete command buttons from the form,
Access does not delete the underlying code attached to
that button. So if, for example, you create a button
called Find_Record using the wizard and later delete it,
the code is still there in the form's module. If you then
create another button called Find_Record you now have two
subroutines in the code. Access gets confused because it
sees two code routines (or more) for the same button. In
essence Access is going "Dude, what's up with us?"

Go look at the code module behind your form and carefully
look around. You will probably see two or more code
routines for Find_Record_Click. Delete the code that is not needed.
Then compile to see if there are any other problems.
That should take care of it.

Here are some KB articles on the subject as well:
You receive an "Ambiguous name detected" error message
while running a procedure in Access 2000 or in Access 2003:
http://support.microsoft.com/?id=817411
ACC97: http://support.microsoft.com/?id=815284

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
V

Van T. Dinh

It sounds like you used the CommandButton Wizard twice but you deleted one
of the CommandButton. Unfortunately, Access doesn't remove the code
associated with the deleted button.

You will need to go into the code module associated with the Form, find the
2 copies "Find_Record_Click" Event Procedure and delete 1 copy.

Make sure you use the Menu Debug / Compile ... after to see if there are
other compilation errors.

HTH
Van T. Dinh
MVP (Access)
 

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