procedure declaration does not match description of event or procedure having the sam

aziz rasul

Active member
Local time
Today, 08:21
Joined
Jun 26, 2000
Messages
1,935
In the Form Load event I have absolutely no code, i.e. the code I had previously has been commented out.

Code:
Private Sub Form_Load()

End Sub

Yet I get an error "procedure declaration does not match description of event or procedure having the same name"? The same thing happens with other events although the Form Load is the first one that errors.
 
Check you haven't got another bit of code in that module with the same event.

Try compiling it to find another one - or better still delete the empty one.
 
check what it says against the form load event in form properties - it should say [Event Procedure]. Or it may be you have changed a subs parameters. Otherwise it may be your vba has become corrupted.

If you think the code is corrupted, suggest copy and paste the entire form module into into notepad - this will get rid of any hidden characters.

Then set the form 'has module' property to no (under the other tab) and save and close the form. This clears all code from the form.

Then reopen the form and copy/paste your code back from notepad. DO NOT just paste the code you just copied to notepad.

You may need to relink the code by entering [Event Procedure] for the relevant form/control events.
 
Thanks all. I ended up compiling the database which threw up a lot of Gremlins which resolved most of the issues. Also I had ended up duplicating some events in my endeavour to find the solution. Having got rid of this as well and all is hunky dory. Phew.
 
it is strongly recommended to include 'Option Explicit' at the top of each module just below 'Option Compare Database'.

You can set this automatically as a default for new modules in the vba window by going to Tools>Options and on the editor tab select Require Variable Declaration
 

Users who are viewing this thread

Back
Top Bottom