2007 - Intermttent On Open Error!!

alathwell

Registered User.
Local time
Today, 06:40
Joined
Apr 11, 2008
Messages
13
:confused:I have a replicated databse that is used in both 2003 and 2007. Most development is done in 2003. I have stability problems with replicated/synchronised databases when running in 2007. The database normally opens with a switchboard menu, but on occassions the following error occurs:-
"THE EXPRESSION ON OPEN YOU ENTERED AS THE EVENT PROPERTY SETTING PRODUCED THE FOLLOWING ERROR: OBJECT OR CLASS DOES NOT SUPPORT SET OF EVENTS". Once this happens the databse will not open. I have to create a new replica which may or may not work. The strange thing is that I can run the database failing in 2007 from another rmachine that is running 2003, so it seems that the problem is specfic running 2007. Any suggestions or help would be appreciated.
 
Hi Thanks for your reply and the link. I haven't really found anything that deals with my immediate problem. I can run the databse no problem in Access 2003 (a replicated version), and it will run for a variable period in 2007 (the same replicated version) then for no apparent reason when starting the database (automatically loading the switchboard) in 2007 the above errors appears only for 2007. It wil still run in 2003.
 
My thought were that since Replication was dropped from Access 2007, they did little or no testing on it and almost anything could be possible.
 
What's in your OnOpen event? It's not likely to have anything to do with it, but it's a start.

Also, does your code compile in both versions of Access?
 
On Open Error in 2007

Hello thank you for your reply. The database compiles perfectly fine in either 2003 or 2007. The error occurs when the database first runs and the Switchboard menu opens, and runs built in default code on the On Open event to popoulate the switchboard with the correct number of buttons. It is the actual On Open Event that is causing the error. It has just happened again. I have to over write the synchronised replica with a newly created replica and it will work for some time, but for no obvious reason the databse will fail again with the On Open error. Once the error occurs any form with code run from the On Open event property will display the same error message.
 
Can you post the OnOpen event code and show us the line that is causing the error?
 
Hi Thanks for your message. There is no specific code as it applies to any form that has code activated in the On Open event property in the form. This can be imbedded code or public. It seems to be the On Open action itself that is the issue. The reason it fails when the database starts up is because I open the Switchboard menu at startup and it has embedded code to manage the number of displayed buttons on the form. This embedded code is run at the On Open event property. I have copied the actual error message below:-
"THE EXPRESSION ON OPEN YOU ENTERED AS THE EVENT PROPERTY SETTING PRODUCED THE FOLLOWING ERROR: OBJECT OR CLASS DOES NOT SUPPORT SET OF EVENTS"
As I say this error doesn't happen all of the time, but once it does the database will always fail in 2007 even though the same actual database instance will run perfectly fine 2003. I will be very interested in your thougths and suggesttons.
Regards alathwell
 
So the issue is with the Switchboard, correct? I would move the OnOpen code to the OnLoad code. The OnLoad event occurs later in the loading sequence as is less prone to the error you are reporting.
 
On Open Error 2007

Thanks for the message. Sorry I may have mislead you. I focused on the Switchboard as it is the first form that opens automatically on startup, and is always where the error first occurs simply becasuse it is the first form that opens and runs an event at On Open. But the problem is with all forms that have an On Open event set to run any code. So in the scheme of things it's the On Open action itself which appears to be the problem, and for clarity only in 2007. 2003 is perfectly fine even with databases that fail in 2007. Without going on too much detail, but to indicate the inconsistency if the replicated databse fails I will close that database and while connected to the corp network I will open the Master Database using the same Access 2007 instance that has failed to open the replicated version that resides on the users pc(laptop) without any trouble. I then create a new replca overwriting the failed replica. After successfully creating a new replica I close the master database and the new replica will work fine for some tirne and then suddenly fail again. This is very frustrating as I am currently in near live situation from a development point of view, but this issue need resolving before I go live in the real sense. Regards alathwell
 
Each version of Access that is released is a little more sensitive than the previous version. Probably because little elements are corrected while the programmer has the code open. The OnOpen event of a form is too early in the opening sequence to reference any controls on a form and that is why I suggested moving your code to the OnLoad event. I rarely use the OnOpen event because of the limitations. It is just a suggestion.
 
On Open Error 2007

Hi thanks for your meaasge. I will try what you suggest and see if it cures the problem. I will let you know.

Thanks again

Regards

alathwell
 
On Open Error 2007

Hi, just to let you know I tried your suggestion and unfortunately I am getting the same error, but nthis time related to the On Load action. The errror message is identical. Let me know if you have any other ideas to try.

Thanks again

Regards

alathwell
 
That's disappointing. Have you checked to make sure you do not have any MISSING references? I'm pretty much out of ideas here. Sorry.
 
On Open Error

Thanks for the message. How do I actually check the references. I am not sure how to do this.

Regards

alathwell
 

Users who are viewing this thread

Back
Top Bottom