Access 2003 Form Will Not Open

U

ursino1

Of serveral forms, only 1 will not open. I can see the VB code, but I can
not open the form. The form seems to be locked.

What happend: I got an out of memory message when openning another form. So
I closed everything. When I reopened it, this happened.

This has happened before, normaly I just copy everything in a new database
and recreate the form, but in this case, I've lost a great deal of work. How
can I fix this?

I need a miracle from the kindness of strangers whom I've always counted on
=) Please please please please
 
A

Allen Browne

No promises, but some things to try.

First thing is to make a backup copy of the mdb, so you get multiple
attempts to rescue the bad form.

1. If you can view the code, copy it out to clipboard, paste it into
Notepad, and save it as a text file.

2. Open the Immeidate Window (Ctrl+G), and enter:
SaveAsText acForm, "Form1", "C:\Form1.txt"
replacing Form1 with the name of your form.
If the form really is bad, this probably won't work.
If it does work, delete the form from this copy of the database, compact the
database:
Tools | Database Utilities | Compact/Repair
or in Access 2007:
Office Button | Manage | Compact/Repair
Then try importing it with:
LoadFromText acForm, "Form1", "C:\Form1.txt"

3. If the form cannot be rescued like that, uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
In Access 2007, it's:
Office Button | Access Options | Current Database | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database.

4. If the form is still bad at this point, decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then open Access (holding down the Shift key if you have any startup code),
and compact again.

5. If you're still stuck, ask Access to recreate the database, import
everything else except the bad form, and then recreate the form. It's the
steps for the first symptom in this article:
http://allenbrowne.com/ser-47.html
If you have an old backup that has this form, you can then import it from
the old backup. Since you have the code associated with the form, it's not
too hard to position the controls on the form, and you can paste in the code
instead of having to re-write it.

HTH
 
Top