Creating a command button

G

Guest

Access won't let me create a command button on a form. I get error message:
"Compile error: Ambiguous name detected: refresh_Click" It doesn't matter
what name I use.
 
R

Rick B

Don't name your button "refresh"

I think that is probably a reserved work in Access.

Rick B
 
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 refresh_Click using the wizard and later delete it,
the code is still there in the form's module. If you then
create another button called refresh_Click 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 refresh_Click. Delete the code that is not needed.
Then compile to see if there are any other problems.
That should take care of it.
 

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