Was working... Now producing error (the sequel)

G

Guest

Just like albycindy, I am getting the message "The expression On Current you
entered in the event property setting produced the following error: Procedure
declaration does not match description of event or procedure having the same
name."

Like her, this code used to work (earlier today, as a matter of fact!). Like
her, I've checked for broken references and don't see any.

In fact, I can reproduce this error from scratch. If I remove the On Current
property from the form which is causing the error along with the sub it
references, the form then works fine (except for the startup code not
running). I can then change the On Current property to [Event Procedure]
using the dropdown box. This creates the empty sub Form_Current with the
header "Private Sub Form_Current()" in the code module, as expected. And the
error reappears!

I'm stumped. Any suggestions?
 
G

Guest

Never mind. I appear to have found the problem.

In case anyone else has a similar problem in the future, here's what caused
mine:

I had an event procedure for an AfterUpdating event on a control on the
offending form which had a declaration that was incorrect. (The declaration
said "Private Sub Ctl_AfterUpdating (Cancel as Integer)"; it should have said
"Private Sub Ctl_AfterUpdating ()" -- that is, without the Cancel parameter.)

Apparently this caused the error to show up on the "On Current" event, as
described, even though the actual error was in a different event procedure, 2
procedures earlier in the code.

Go figure...
 

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