Compile Error Opening Form

DBFIN

Registered User.
Local time
Today, 10:57
Joined
May 10, 2007
Messages
205
A receive a compile error when an OpenForm macro action is executed. The error message is: The form you referenced may be closed or may not exist in the database. Microsoft Access may have encountered a compile error in a Visual Basic module for the form.

How do I fix this compile error ?
 
Here are instructions or just google "decompile access database": http://www.fmsinc.com/MicrosoftAccess/Performance/Decompile.asp

Save a copy and decompile it.

To make it easier in the future, you can save a shortcut to your desktop. When you need to decompile just change the properties to point to the most current copy of your database.

This has worked wonders for me when I start getting odd unexplainable errors...
 
Thanks, I will try this, I appreciate the quick response !!
 
Have you set an AutoExec Macro to open a Form? Or have you set the options to open a default form under File -> Options -> Current Database -> Display Form? If yes, make sure the form you have set to open exists or have not been renamed. If it has been renamed, change it accordingly. Or if the form no longer exists, delete the AutoExec macro or the Display form whichever is appropriate in your situation !
 
I following your instructions by inputting:

C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE/decompile

I received error that pathway could not be found. I navigated to this exact location and found MSACCESS.EXE, so I don't know why I'm getting this error message.
 
Decompile, should be your last resort ! Try what I have suggested in Post #5.

There is a small problem with your Decompile statement. It should be..
Code:
"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "[B][COLOR=Blue]C:\My Documents\yourPath[/COLOR]\[COLOR=Red]yourFile.mdb[/COLOR][/B]" /decompile
The highlighted section should point to your file where it is located. Checkout my blog post on how to perform a Decompile.
 
Duplicate post
 
Decompile, should be your last resort !

True enough! But after you've checked everything over and there still is no clear explanation for an error, decompiling usually works.

Rereading this post, it is probably something with the form name being incorrect.

@ DBFIN: If you try removing the open form macro does the error disappear??
 
You are spot on Eternal. I was able to decompile and compact. I later found the actual cause was very simple. I stepped through each macro step and discovered new code that I just added yesterday. The code was accurate but missing the openform action that was needed to evaluate the code.

This was my error. My stupidity. I get better with each mistake.
 
True enough! But after you've checked everything over and there still is no clear explanation for an error, decompiling usually works.
Totally agree and it is true "mostly" Decompiling works. BUT it also could make things much worse. But the reason I stressed that was because, the OP did not seem to have done anything with the error. OP, just saw the error and then just asked it in the Forum, so I thought he/she should do something before a Decompile.
 

Users who are viewing this thread

Back
Top Bottom