Form won't open anymore

J

Jon22

I was working on a form in design view and was adding a subform. When I
finished the wizard I resized and repositioned it and clicked save. A message
box came up saying "There is not enough memory to perform this operation.
Close all other programs and try again" I did this but still the same
message. The only way out of it was closing the form without saving it. Now
when I try to open the form it doesn't open in either design view or normal
view. When I try to open it from my menu with a button I get the runtime
message 2001 "You cancelled the previous operation". I have had this happen
to me before but I can't remember how I fixed it or if I just deleted the
form and started again but this would mean a lot of work for me. I have since
deleted the subform that was created just prior to the bug. Any suggestions
would be appreciated.
 
C

Crystal (strive4peace)

Ji Jon,

I have had success (not always) backing up to and restoring
from a text file

* for this type of corruption, I found that neither
decompile, compact/repair, nor importing objects to a new db
worked ... but I have been able to get everything back, so
far, using SaveAsText and LoadFromText :)

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub BackupOne()
On Error GoTo Proc_Err
Application.SaveAsText acForm, "FormName" _
, "c:\path\FormName.txt"
MsgBox "done saving FormName"

Proc_Exit:
Exit Sub

Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " BackupOne "
Resume Proc_Exit
Resume
End Sub

' After saving to text, delete the form
' (or put the code in another database without the form)
' make sure you backed up the database first
' Then...

Sub RestoreOne()
LoadFromText acForm, "FormName" _
, "c:\path\FormName.txt"
MsgBox "done restoring FormName"
End Sub

'~~~~~~~~~ Compile ~~~~~~~~~

Whenever you change code, references, or switch versions,
you should always compile and save before executing.

from the menu in a VBE (module) window: Debug, Compile

fix any errors on the yellow highlighted lines

keep compiling until nothing happens (this is good!) -- then
Save

~~
if you run code without compiling it, you risk corrupting
your database

~~~~~ also be sure to use Option Explicit at the top of each
module so variables that are not declared or are misspelled
will be picked up



Warm Regards,
Crystal
remote programming and training

http://MSAccessGurus.com

My Analyzer
.... the ultimate Data Dictionary Tool
by Crystal
http://www.AccessMVP.com/strive4peace/Dictionary

*
:) have an awesome day :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top