Procedure declaration does not match description of event (1 Viewer)

exaccess

Registered User
Joined
Apr 21, 2013
Messages
287
Below is the error message that I am getting each time I press a command button on a form called ConFedFm. I looked at the statements in the calling form and the called form , parameters passed, spellings etc. All look alright. Help is highly appreciated

"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"
 

MarkK

Super Moderator
Joined
Mar 17, 2004
Messages
7,761
You get this error in your code when you write an event handler that doesn't exactly match the event signature, so you know this event handler, right?...
Code:
private sub form_open(cancel as integer)
The event is called Open, it is raised by the Access.Form class, and it passes an integer. If you want to cause the error you are getting, write the handler as follows....
Code:
private sub form_open(cancel as [COLOR="Blue"]long[/COLOR])
In this case the signature of the event handler does not exactly match the signature of the event being raised. For some objects this error will be a compile error, but if you are getting this while using an active x object, it may be harder to find, like maybe this is the click event of a treeview control, which may not fail until you open the form that contains the control.
Hope this narrows it down a little...
If not, post the DB.
 

Cronk

Registered User
Joined
Jul 4, 2013
Messages
2,235
You can get that error if you add a parameter to an event procedure
eg
Private sub CommandButton_Click()

has a parameter added to it, as in

Private sub CommantButton(x as variant)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom