The expression On Click you entered ...

I was getting the below error message in Access 2003 when I clicked on a command button.  Likely because I was working on a form module and possibly saved it while the form was in regular view and not in design view.

"The expression On Click you entered as the event property setting produced the following error:
Object or class does not support the set of events."

TheExpressionOnClick

Commenting all the code behind the form did not fix the problem. 

Setting the Has Module to No and saving the form, surprisingly, did not fix this problem.

Decompiling the MDB also did not fix the problem.

This problem also existed when I opened up the MDB in Access 2000 and clicked on a button on the form.

Importing all the objects into a new MDB finally did the job.

Hint: when importing lots of objects into a new MDB minimize the database container window before importing. Access will import much, much faster.

As a bonus a child sub form which wasn't saving the parent value in the child table also started working properly. 

As a side note every hour or two I always go into Windows Explorer, click on the MDB and do a Ctrl+C and a Ctrl+V to copy the FE MDB.  Every few days I zip all those and move them to an archive folder.

Published Tuesday, April 22, 2008 10:40 PM by Tony
Filed under: ,

Comments

# re: The expression On Click you entered ...

Thank you so much for sharing this information.  I am a VBA student and was stuck with the error.  Your information has helped me tremendously.

Wednesday, April 23, 2008 1:50 PM by Michelle

# re: The expression On Click you entered ...

I've actually had this happen a couple of times over the last year or so while working on my current project (which finally goes into production tomorrow!). Importing all objects into a new container always fixed the problem. Anytime I start getting 'odd' errors I figure it's time to import and it usually works to 'cure' the problem.

Wednesday, April 23, 2008 2:55 PM by Judy Reese

# re: The expression On Click you entered ...

I used to have a lot of Form tgat became corrupted.  I changed allow design changes to Design View Only and it rarely occurs now.  Before you import the entire database you can try this.  Right click on the Form in the database window and save a copy.  Rename the original Form in case you need it later.  Then rename the new Form with the original Form name.  This usually takes care of Form corruption.

Best Regards,

Pat Wood

Thursday, April 24, 2008 10:19 AM by Patrick Wood

# re: The expression On Click you entered ...

Pat Wood was dead on in resolving this issue.  Thanks Pat!!

Wednesday, August 27, 2008 10:25 AM by Rich J

Leave a Comment

(required) 
(required) 
(optional)
(required)