Genius required - #error in field

ryetee

Registered User.
Local time
Today, 16:59
Joined
Jul 30, 2013
Messages
952
I have a funny

I display a form (and sub form). The form displays summed totals from the subform. This used to work no problem at all. I now get #error in most of the fields except one that now says #type!. On investigation I went into design view and then back to form view where I get an error message stating The expression On Load you entered as the event property setting produced the following error: Return without GoSub. After I click OK I get my form up but still with the above errors

Now the funny bit. If I display the form and then go to database tools, visual basic and add any watch even if the watch doesn't exist then when I go into design view and then back to form view I don't get the error message and all of my fields now work.

I can exit the form and go back in and everything is OK. If I close the database down and then go back to the form I get the original problem from above.

Any geniuses out there that can help will be most welcome as this is driving me to drink!
 
Not a genius but you should go into your code and try to decompile (Alt+f11 then Debug>Decompile). It sounds like a problem with your code.
 
By the way, based on the content of the error message it sounds like the problem is on the OnLoad and that you may have left out Private Sub (or another identifier for the procedure) but sometimes these error messages say one thing and the error is really somewhere else...
 
thanks for the suggestions but i've actually just copied and pasted the database and the copied version works fine!!

in fact renaming the old version works as well.

all a bit worrying if errors can appear and disappear without any explanation
 
Last edited:
Okay but it still sounds like there is something going on and that the issue may crop up again. You may want to make a copy and decompile your database
 
Yes, go into the code window and compile and see if any errors appear.

However, if the issue crops up again and you have searched high and low for a cause and none is found, you also may need to decompile your database:

http://stackoverflow.com/questions/3266542/how-does-one-decompile-and-recompile-a-database-application

People will rightfully tell you to err on the safe side and not to jump into a decompile but I have had similar errors (#name, #error) that would come and go for no apparent reason and decompiling was the only thing that worked.

That hasn't happened to me in awhile since my coding has improved so I do believe it is a result of imperfect code.
 
If you do end up decompiling, save a copy of your database first. If you just compile in the code window (ALT+F11) you need not save a copy.
 
OK I'lltake a look at this but when I tried alt F11 it just toggles between my code and forms...
 

Users who are viewing this thread

Back
Top Bottom