New error on open of database

buratti

Registered User.
Local time
Today, 14:11
Joined
Jul 8, 2009
Messages
234
Hello again. I am getting an error on the open of my database and I cant figure out why. The error is: "The expression OnOpen you entered as the event property setting has produced the following error: Return without Go Sub." Now I have narrowed the problem down to the open of my startup form. If I hold shift and open my database, I do not get the error, but when I try to open the startup form manually I get the same error. Now here is the kicker... I have not changed anything in the OnOpen event of the form since it last worked correctly. To make it even more strange, if I open the form in design view, then go to the onOpen event in the properties panel and open VBA editor from there, and not even edit anything, but just open VBA, then go back to access and switch to form view, it opens just fine. When I close the form it asks if I want to save the changes, which is strange because I did not change a thing, and regardless if I click yes or no, the form opens just fine for the rest of the database session. But upon close and reopen of the database, I get the same error again.


Well, after writing this but before posting I tried something and I think I fixed it, but rather then just delete what I worte I thought I'd post anyway to see if anyone knows what caused the problem. What I did to fix it was comment out the whole onOpen procedure of the form, save and close the form and database, reopen the database, uncomment the onOpen procedure, save and close everything again, then reopen again and everything is now fine.

Problem solved, but does anyone know why it was acting like it was? i did do a compact and repair, but that did not fix it before.
 
Sorry for the delayed response... No not usually, but I did compile it when I was having the problem and no errors. It is working now, so its not that important to figure out why it was happening, just thought I'd post and ask since I already wrote it BEFORE i fixed it myself.
 
I see.

I make it a habit to compile code as I go along. Maybe that would have helped stopped this problem from occuring in the first place.
 
Yeah, I too compile every few minutes. Sometimes every few seconds. It's a habit just like Ctrl+S. I recommend the same to you.
 

Users who are viewing this thread

Back
Top Bottom