Full Version: Form No Longer Opens....i Have A Very Complex Form
UtterAccess Forums > Microsoft® Access > Access Forms
hokie1
.....that has been working perfectly for 2-3 years with lots of multiple user activity.
Has several subforms, command buttons, fields etc.
I had to make some relatively minor changes to the form today and now it will not open at all. Even in design mode.
I have checked everything I know to check ...data sources, etc. to no avail.
I've tried copying it into its current DB with a new name....no luck
I've tried importing it into another db ..still no luck.
ANY suggestions as to how I might go about resurrecting this form before I start rebuilding it from a back up?
Thanks for all suggestions.
MikeLyons
Sounds like a bit of binary corruption.
One other trick to try which has occasionally helped me recover a corrupted form.
First, make a backup copy of your application just in case.
Second, in the Immediate window, you want to invoke a hidden and undocumented method of the Application object called SaveAsText
CODE
Application.SaveAsText acForm, "your_form_name", "path_and_filename.txt"

(obviously replacing the form name and path with your form name and the desired location and filename)
This will output a text copy (as long as the form isn't TOO badly damaged)
Third, rename or delete the corrupted form from the database
Fourth, compact and Repair the application
Fifth, back at the Immediate Window,
CODE
Application.LoadFromText acForm, "your_form_name", "path_and_filename.txt"

With any luck, you should be able to open the form.
If not, you should still have a text file that contains the definition of the form, describing the controls and the code which should save you some time if you end up having to recreate the form from scratch.
Hope this helps
Mike
hokie1
Thanks for your feedback. The VB Statements you gave me worked perfectly for a "test" form so your recommended
process worked for that situation.
However, when I tried to "save" my problem form ACCESS from, ACCESS itself closed with an error condition and the "save" did not take place.
Otried several time with the same result.
I conclude from this my form is so badly corrupted it is not salvageable.
I do have a fairly recent back up I can rebuild from.
Thanks for your help, the knowledge you conveyed in your suggestion will be very useful to me in future situations.
MikeLyons
No problem - it was worth a shot. Once you have your backup though, I would still suggest you might want to run through the process - it is possible that your recent backup could be on the verge of the same corruption that bit you.
ike
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.