Pressing any button results in error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Whenever I press any button on my form I get the same error:

"The expression ON CLICK you entered as the event property setting produced
the following error:
Procedure declaration does not match description of event or procedure
having the same name."

This started all of the sudden for all of my buttons on this form. I tried
creating a click event with only the procedure name and end sub and got the
same error. I'm dead in the water.

Thoughts?
 
Hi, Rod.
Whenever I press any button on my form I get the same error:

You have a compile error. To find it, open the VB Editor, then select the
Debug -> Compile <DatabaseName> menu. The compile error will be highlighted.
Ensure that there are no arguments between the parentheses in the
procedure's declaration. For example:

This:

Private Sub DoneBtn_Click()

Not this:

Private Sub DoneBtn_Click(nSomeNum As Long)
I'm dead in the water.

Nah. The compiler will give you a hint where the error is. You just have
to fix whatever is wrong with the syntax on that line.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Hi, Rod.

Come to think of it, there are some built-in procedures in forms that
contain an argument or two that would cause this error if they aren't
correct. For example:

This is correct:

Private Sub Form_BeforeUpdate(Cancel As Integer)

This following one will give a compile-time error, because it's missing a
required argument in the declaration:

Private Sub Form_BeforeUpdate()

So it depends upon which procedure is giving you the problem. If you can't
figure out how to correct the procedure declaration that the compiler
highlights, please post back.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Back
Top