Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form used to work great - now will not open 2

Status
Not open for further replies.

KevEarthwatch

Technical User
Apr 23, 2009
6
US
I created a form to display some results of a query - and it used to work fine.

Just this afternoon after making a few final touches and saving it, I am no longer able to open the form. I receive a "not enough memory to perform this operation" error message.

I am not sure why this would have happened, If it is helpful, i had finished adding some simple command buttons for my last updates (save record, open form, find record, etc.)

Below is the Code for the form, i was unable to find any apparent errors etc. Any help would be amazing - i would really hate having to recreate this work.
-----------------------------------------------------------
Option Compare Database

Private Sub Filter_by_Team_Start_Date_Click()
On Error GoTo Err_Filter_by_Team_Start_Date_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_Filter_by_Team_Start_Date_Click:
Exit Sub

Err_Filter_by_Team_Start_Date_Click:
MsgBox Err.Description
Resume Exit_Filter_by_Team_Start_Date_Click

End Sub
Private Sub Opens_View_my_Tracking_Information_Click()
On Error GoTo Err_Opens_Opens_View_my_Tracking_Information_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Show Forms"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Opens_View_my_Tracking_Information_:
Exit Sub

Err_Opens_View_my_Tracking_Information_Click:
MsgBox Err.Description
Resume Exit_Opens_View_my_Tracking_Information_

End Sub
Private Sub Finds_a_record_by_grant_name_Click()
On Error GoTo Err_Finds_a_record_by_grant_name_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Finds_a_record_by_grant_name_Click:
Exit Sub

Err_Finds_a_record_by_grant_name_Click:
MsgBox Err.Description
Resume Exit_Finds_a_record_by_grant_name_Click

End Sub
Private Sub Opens_report_Tracking_Click()
On Error GoTo Err_Opens_report_Tracking_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "View my Tracking Information"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Opens_report_Tracking_Click:
Exit Sub

Err_Opens_report_Tracking_Click:
MsgBox Err.Description
Resume Exit_Opens_report_Tracking_Click

End Sub
Private Sub Finds_A_Record_Click()
On Error GoTo Err_Finds_A_Record_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Finds_A_Record_Click:
Exit Sub

Err_Finds_A_Record_Click:
MsgBox Err.Description
Resume Exit_Finds_A_Record_Click

End Sub
Private Sub Save_Changes_Click()
On Error GoTo Err_Save_Changes_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Save_Changes_Click:
Exit Sub

Err_Save_Changes_Click:
MsgBox Err.Description
Resume Exit_Save_Changes_Click

End Sub
 
Have you tried a compact and repair?

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Are their any complicated expressions in the controls? did you rename any controls?

I've had this happen before, just can't remember exactly what I did to solve it, but did you try taking out all the changes you made?

dosen't help you now...

* note to self...always make regular backups when making changes, I will literally make a copy of the database everyday (named with date) whenever I start to make changes..then you can easily import any objects that behave unexpectedly.
 
I have tried compact and repair - to no avail. I read somewhere else to try and "decompile" the database, but am not 100% clear on how to do it. Any clarification on that would be great - seems it is what might work. I am a novice at access SQL, VBA etc.

I did happen to rename some command buttons and delete others as I was workign on the form (however, the code for those still remains in what is posted above however). I tried deleting those segments of code, but receive the same error message as when i try to open the form each time.
 
You use a command line paramter to decomplie...

Code:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile ""c:\Database Folder\Database.mdb"

Either put an appropriately updated statement in the target of a shortcut, a batch file, or execute via run on the start menu. It may work via the command line.

Personally I always start with a shortcut to the Access Program and then add the /decompile <target File>.

The other thing you might try for cleaning up corruption is to import everything into a new file. You will have to manually set your startup parameters and any security again.
 
well - i tried and tried, but ultimately decided to delete the corrupted form and start over again (it wasnt to complex a form to redo).

However, as I was designing the form , and attempted to switch from design view to form view, the database crashed and I lost all of my progress. Because of this, I worry that the problem is deeper than this single form. Currently the database is set up for multiple users, some with different versions of office 2003 or 2007.

Could this be causing problems? What are my best next steps to take? Great fun this.....
 
I would use Access 2003, import everything to a new file. Split your database if you haven't already done so. Keep your frontend for development and NEVER open it with a later version of Access. Put the clean version out to some distribution point. Ensure that users get updates of the file but never open the distribution file.

When a later version of Acces opens an earlier version, it creates tempory objects in space that looks unused to earlier versions. While it shouldn't happen, it is possible for corruption. This means that the first time an Access 2007 user opens an update, it will take longer but such is a multiple version environment. Alternately you could maintain 2 frontends and upgrade to a copy of your 2003 database everytime you make a change.
 
You should be ok with different versions...just make sure 2007 has SP2 ( even though it has it's own bugs). I've had that happen to me as well ( crash in design), keep trying but save in increments and don't try to rebuild it too fast...switching back and forth to see at what point it might crash.

otherwise do what lameid suggests, by importing all to a new one....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top