Form won't open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form in an Access 97 database with quite a bit of code behind it. I
must have done something in the code module because now the form won't open.
Here are the symptoms:
1. When I click on the form in the Database Window, nothing happens.
2. If I go into the code modules and double click on the form I get a
message saying "You canceled the previous operation." After getting this
message a couple of times and clicking OK each time, the module opens.
3. If I try to save the module, I get a message saying "Save operation
failed."
Any suggestions would be greatly appreciated.
Thanks in advance
 
Yes, this is a corruption.

First, make a backup copy of the damaged database (without overwriting any
existing backups), so you get multiple chances to fix it.

If you are able to get the module to open at all, can you select all the
text (Ctrl+A), copy to clipboard (Ctrl+A), and then paste it into (say)
Notepad? If so, you are very lucky: you will be able to create a new form,
and paste in this code.

You may also be able to export the form itself with the undocumented
SaveAsText:
SaveAsText acForm, "Form1", "C:\Form1.txt"
Then you can recreate the form with:
LoadFromText acForm, "Form1", "C:\Form1.txt"

After that, try a decompile. Enter 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"

If the corruption is deeper than that, try rebuilding the database by
following the 6 steps for the first symptom in:
Recovering from Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Back
Top