D
Don Barton
This post is for anyone who has seen this problem. I have posted a
solution below.
Situation: The error message "Object or class does not support the set
of events" occurred in my database just after I received a "database
corruption error". The corruption error appeared right after I closed
then reopened my database. I assumed this happened because I opened
it immediately after it crashed and I had recently set the database to
auto compact & repair on close. MS Access asked me if I wanted to
save a backup, and I said yes. After this, neither the original
database, nor the backup would work; getting the "Object or class does
not support the set of events" everytime.
My system setup was Access2003 and Windows Vista Home Premium. The
database was in a front end and back end configuration, error showed
up in front end only.
This is what I found:
(If you don't care about the steps I went through to isolate the
problem, go to #6)
1. All my queries had detached themselves from my tables. All the
fields in the queries were prefaced with Expr 1, Expr 2, Expr3,
etc... I cleaned up all the queries and resaved them. The queries
worked when run independently (outside the form), but not when
attached to the form.
2. Looked at my references. I unchecked them, saved the database,
then reopened and rechecked the references. Then closed and reopened
the database, and still received the error.
3. Read everything I could on newsgroups to try to solve it.
Recommendation was to create a new database and load all objects in
via import. Did compact/repair. The compact/repair was successful.
But the error still showed up just about everytime I loaded a form.
It was also recommended by someone in the newsgroups to SaveAs Text
all the offending forms, then reload them to their original state in a
new database. Since almost ALL my forms were showing this error, I
chose not to do this.
4. I finally isolated the problem. Any time there is a call to an VBA
event, the error would arise. Removing all VBA code from a form
allowed the form to load properly, unfortunately, all functionality
programmed with the VBA was gone. Not an acceptable solution.
5. Next I created a new blank database and made a simple form (no
table/query attached) and wrote one line of code behind the OnOpen
event: "Msgbox "Does this code work?". On opening the new form I
received the "Object or class does not support the set of events"
error again. NOTE: This was a new database with only one form
object. It had none of my "corrupted" database in it.
6. Deleted MS Access from my computer, and reinstalled it and
downloaded the latest service packs. I next ran my old database
and ... it worked perfectly.
The problem was not the database I created, but something within MS
Access itself had become corrupted.
I am not saying this is the only way to get rid of this error, but it
after expending all my available options, this worked for me.
I hope this helps in trouble shooting and saves you some time.
Don
solution below.
Situation: The error message "Object or class does not support the set
of events" occurred in my database just after I received a "database
corruption error". The corruption error appeared right after I closed
then reopened my database. I assumed this happened because I opened
it immediately after it crashed and I had recently set the database to
auto compact & repair on close. MS Access asked me if I wanted to
save a backup, and I said yes. After this, neither the original
database, nor the backup would work; getting the "Object or class does
not support the set of events" everytime.
My system setup was Access2003 and Windows Vista Home Premium. The
database was in a front end and back end configuration, error showed
up in front end only.
This is what I found:
(If you don't care about the steps I went through to isolate the
problem, go to #6)
1. All my queries had detached themselves from my tables. All the
fields in the queries were prefaced with Expr 1, Expr 2, Expr3,
etc... I cleaned up all the queries and resaved them. The queries
worked when run independently (outside the form), but not when
attached to the form.
2. Looked at my references. I unchecked them, saved the database,
then reopened and rechecked the references. Then closed and reopened
the database, and still received the error.
3. Read everything I could on newsgroups to try to solve it.
Recommendation was to create a new database and load all objects in
via import. Did compact/repair. The compact/repair was successful.
But the error still showed up just about everytime I loaded a form.
It was also recommended by someone in the newsgroups to SaveAs Text
all the offending forms, then reload them to their original state in a
new database. Since almost ALL my forms were showing this error, I
chose not to do this.
4. I finally isolated the problem. Any time there is a call to an VBA
event, the error would arise. Removing all VBA code from a form
allowed the form to load properly, unfortunately, all functionality
programmed with the VBA was gone. Not an acceptable solution.
5. Next I created a new blank database and made a simple form (no
table/query attached) and wrote one line of code behind the OnOpen
event: "Msgbox "Does this code work?". On opening the new form I
received the "Object or class does not support the set of events"
error again. NOTE: This was a new database with only one form
object. It had none of my "corrupted" database in it.
6. Deleted MS Access from my computer, and reinstalled it and
downloaded the latest service packs. I next ran my old database
and ... it worked perfectly.
The problem was not the database I created, but something within MS
Access itself had become corrupted.
I am not saying this is the only way to get rid of this error, but it
after expending all my available options, this worked for me.
I hope this helps in trouble shooting and saves you some time.
Don