All event routines broke suddenly !

G

Guest

I just finished a bit of coding for a form in an Access Project, and when I
switched back to Form View I got:

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

I deleted the Form_Load event routine and the form loaded OK. But, any
control I click now produces the same error (but with "On Load" replace by
"On Click", or whatever).

I can't see anything wrong with names of objects or event routines. Where
do I start to fix this?
 
M

missinglinq via AccessMonster.com

You've probably placed part of a sub routine within another, so that your Sub.
..End Sub's don't match. This usually happends when you Copy and Paste code
into pre-existing code. You need to start at the top of your form's code
module and look for your mistake. No matter where the mistake happened Access
willl tell you it has to do with the OnLoad, which it usually really doesn't.
If you haven't already saved your form since this started, try simply exiting
and respond No when asked to save it.

Good luck
 
G

Guest

Thanks missinglinq,

I found it. It seems I created this routine my mistake:

Private Sub grpFileType_BeforeUpdate(Cancel As Integer)

then I edited the name to:

Private Sub grpFileType_AfterUpdate(Cancel As Integer)

and the problem was caused by the presence of the argument. When I changed
this to:

Private Sub grpFileType_AfterUpdate()

everything was sweet again!
 
M

missinglinq via AccessMonster.com

Glad you got it sorted; that's a new cause for the problem to me!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
G

Guest

missinglinq via AccessMonster.com said:
Glad you got it sorted; that's a new cause for the problem to me!

And an infinite number of cats in need of skinning!
 

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

Similar Threads


Top