Solved

There isn't enough memory to perform this operation.  Close unneeded programs and try the operation again.

Posted on 2004-10-07
16
1,912 Views
Last Modified: 2012-08-13
Hello everyone, I need help! I have very little Access experiance. One of the Forms designed by a now departed programmer gives us "There isn't enough memory to perform this operation.  Close unneeded programs and try the operation again." Whenever we click on this paticular button. All the other buttons work fine. This is the event procedure:

Option Compare Database   'Use database order for string comparisons

Private Sub Button0_Click()
On Error GoTo Err_Button0_Click

    Dim DocName As String
    Dim LinkCriteria As String

    DocName = "Main"
    DoCmd.OpenForm DocName, , , LinkCriteria

Exit_Button0_Click:
    Exit Sub

Err_Button0_Click:
    MsgBox Error$
    Resume Exit_Button0_Click
   
End Sub

Private Sub Button2_Click()
On Error GoTo Err_Button2_Click


    DoCmd.Close

Exit_Button2_Click:
    Exit Sub

Err_Button2_Click:
    MsgBox Error$
    Resume Exit_Button2_Click
   
End Sub

Private Sub Button4_Click()
On Error GoTo Err_Button4_Click

    Dim DocName As String
    Dim LinkCriteria As String

    DocName = "Reports Form"
    DoCmd.OpenForm DocName, , , LinkCriteria

Exit_Button4_Click:
    Exit Sub

Err_Button4_Click:
    MsgBox Error$
    Resume Exit_Button4_Click
   
End Sub

Private Sub Button5_Click()
On Error GoTo Err_Button5_Click

    Dim DocName As String
    Dim LinkCriteria As String

    DocName = "Table Edit Form"
    DoCmd.OpenForm DocName, , , LinkCriteria

Exit_Button5_Click:
    Exit Sub

Err_Button5_Click:
    MsgBox Error$
    Resume Exit_Button5_Click
   
End Sub

Sub Command7_Click()
On Error GoTo Err_Command7_Click

    Dim stDocName As String

    stDocName = "Short Notice Report"
    DoCmd.OpenReport stDocName, acPreview

Exit_Command7_Click:
    Exit Sub

Err_Command7_Click:
    MsgBox Err.Description
    Resume Exit_Command7_Click
   
End Sub
Sub Command8_Click()
On Error GoTo Err_Command8_Click

    Dim stDocName As String

    stDocName = "Waiting List Report 2"
    DoCmd.OpenReport stDocName, acPreview

Exit_Command8_Click:
    Exit Sub

Err_Command8_Click:
    MsgBox Err.Description
    Resume Exit_Command8_Click
   
End Sub
Sub Command9_Click()
On Error GoTo Err_Command9_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Confirmation Check Form"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command9_Click:
    Exit Sub

Err_Command9_Click:
    MsgBox Err.Description
    Resume Exit_Command9_Click
   
End Sub
Sub Command11_Click()
On Error GoTo Err_Command11_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Completed Main"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command11_Click:
    Exit Sub

Err_Command11_Click:
    MsgBox Err.Description
    Resume Exit_Command11_Click
   
End Sub
Sub Command12_Click()
On Error GoTo Err_Command12_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "IA Main"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command12_Click:
    Exit Sub

Err_Command12_Click:
    MsgBox Err.Description
    Resume Exit_Command12_Click
   
End Sub
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Amy"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command13_Click:
    Exit Sub

Err_Command13_Click:
    MsgBox Err.Description
    Resume Exit_Command13_Click
   
End Sub
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Anita"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command15_Click:
    Exit Sub

Err_Command15_Click:
    MsgBox Err.Description
    Resume Exit_Command15_Click
   
End Sub
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Candy"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command16_Click:
    Exit Sub

Err_Command16_Click:
    MsgBox Err.Description
    Resume Exit_Command16_Click
   
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Edie"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command17_Click:
    Exit Sub

Err_Command17_Click:
    MsgBox Err.Description
    Resume Exit_Command17_Click
   
End Sub
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Lucy"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command18_Click:
    Exit Sub

Err_Command18_Click:
    MsgBox Err.Description
    Resume Exit_Command18_Click
   
End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Natasha"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command19_Click:
    Exit Sub

Err_Command19_Click:
    MsgBox Err.Description
    Resume Exit_Command19_Click
   
End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Not Yet Assigned"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command20_Click:
    Exit Sub

Err_Command20_Click:
    MsgBox Err.Description
    Resume Exit_Command20_Click
   
End Sub
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Wilson"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command21_Click:
    Exit Sub

Err_Command21_Click:
    MsgBox Err.Description
    Resume Exit_Command21_Click
   
End Sub
Private Sub Command23_Click()
On Error GoTo Err_Command23_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Lela"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command23_Click:
    Exit Sub

Err_Command23_Click:
    MsgBox Err.Description
    Resume Exit_Command23_Click
   
End Sub
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "ADHD Main"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command24_Click:
    Exit Sub

Err_Command24_Click:
    MsgBox Err.Description
    Resume Exit_Command24_Click
   
End Sub
Private Sub Command25_Click()
On Error GoTo Err_Command25_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Case coordinator assignments"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command25_Click:
    Exit Sub

Err_Command25_Click:
    MsgBox Err.Description
    Resume Exit_Command25_Click
   
End Sub
Private Sub Run_Service_Time_Check_Report_Click()
On Error GoTo Err_Run_Service_Time_Check_Report_Click

    Dim stDocName As String

    stDocName = "Service Time Report"
    DoCmd.OpenReport stDocName, acPreview

Exit_Run_Service_Time_Check_Report_Click:
    Exit Sub

Err_Run_Service_Time_Check_Report_Click:
    MsgBox Err.Description
    Resume Exit_Run_Service_Time_Check_Report_Click
   
End Sub
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click

    Dim stDocName As String

    stDocName = "birth to 3 times"
    DoCmd.OpenReport stDocName, acPreview

Exit_Command27_Click:
    Exit Sub

Err_Command27_Click:
    MsgBox Err.Description
    Resume Exit_Command27_Click
   
End Sub
Private Sub Command28_Click()
On Error GoTo Err_Command28_Click

    Dim stDocName As String

    stDocName = "IESC 45 day Report"
    DoCmd.OpenReport stDocName, acNormal

Exit_Command28_Click:
    Exit Sub

Err_Command28_Click:
    MsgBox Err.Description
    Resume Exit_Command28_Click
   
End Sub


Any Ideas? Again, I have no idea how to "read" this so please talk slow and use simple words :)
0
Comment
Question by:vand
  • 7
  • 2
  • 2
  • +3
16 Comments
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
Hello vand,

> Whenever we click on this paticular button.

Which button?

Pete
0
 
LVL 11

Accepted Solution

by:
Jokra_the_Barbarian earned 250 total points
Comment Utility
I don't see any problem with the form code itself, shouldn't be the problem. The reason why Pete asked which button (I think) is because the problem most likely is with the Form or Report that is opened.

1. Determine which button click event(s) cause the memory message to appear.
2. Look at the recordsource for that Form or Report. It is most likely a huge recordset that is being loaded into memory.

If you need additional help once you've identified the Form(s) or Report(s), give us more detail.
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
Comment Utility
Issues that may be causing the error message:

1) You don't explciitly close any recordsets and set them to Nothing, which means that the memory being used may not be being released.
2) You have a graphic on the form, or one that is being dynamically changed regularly - this can eat up stack space very rapidly.
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
Comment Utility
Also ensure that you are up to date with Office and Jet service packs.
0
 
LVL 6

Author Comment

by:vand
Comment Utility
Thank you for the quick responses!

The "button" is on the form that comes up when you launch the mdb. It is called "Startup form" the button is named "referal information" the code that I pasted is what comes up when I go to design view, right click the button and select build event.

How do I determine the record source?

How do I identify the form or report?
0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 250 total points
Comment Utility
Since you're unfamiliar with Access, I'll try to explain a few things to help this along.

The code you posted is filled with event procedures for buttons on a form.  My guess is the form is some type of switchboard for your app, allowing to choose among the necessary or most common tasks you need.  Each button will attempt to open a form, open a report, or exit the app (only button 2 does this option).  Each procedure, including button 2, pretty much follow the same template, and I tried to explain this in great detail below.  We will need to know which button you are having problems with to help track this down.  Also, if you can tell us how much memory you have on your computer, that would be handy.  You can find this information by right-clicking the "My Computer" icon on the desktop, and selecting "Properties" from the menu.  You should see something like "xxx,xxx KB RAM" at the bottom of the page.

' BTW, lines with an apostrophe (') in front are comment lines, and do not affect code execution.
'
' Private Sub means "I am declaring a subroutine, and it will only be accessible to this form"
' Button0_Click is the name of the sub, and the particular format of the name indicates it is handling the OnClick event for Button0.
Private Sub Button0_Click()
' If an error pops up, find the label Err_Button0_Click and continue executing from that point.
On Error GoTo Err_Button0_Click

' Variable declarations.  Both are strings, which means text.
    Dim DocName As String
    Dim LinkCriteria As String

' Assign the string "Main" to the variable DocName
    DocName = "Main"
' If you press F2 while looking at the code, you will bring up the object browser.
' In the left pane is a list of classes and objects you have available to this project.
' In that list, find DoCmd.  In the right-hand pane will now be a list of all functions and
' properties available to the "DoCmd" class.  Find OpenForm, highlight, and press F1.
'
    DoCmd.OpenForm DocName, , , LinkCriteria
'                               ^^^^^        ^^^^^^^
'                             Form Name     "WHERE" condition
' This carries over to OpenReport, also.

' This is a label.  This provides a convenient exit point for the sub.
Exit_Button0_Click:
    Exit Sub     ' <---  Exit the sub immediately and return to the calling object/procedure.

' Remember that On Error... code above?  Here's the label it goes to in the event of an error.
Err_Button0_Click:
' This displays a message box with the error name, then resumes code execution at the other label.
    MsgBox Error$
    Resume Exit_Button0_Click
   
' Indicates the structural end of the sub.
End Sub
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
(Default Help Desk response)  Reboot your pc and try again.  Also, when you do this, try not to open a lot of other applications while you are running this particular Access database.

Hope this helps.
-Jim
0
 
LVL 50

Expert Comment

by:Steve Bink
Comment Utility
You can determine the RecordSource for a form or report by opening the object in Design View.  Right-click the small square in the upper-left corner (where the rulers 'join'), and select Properties.  Make sure the combo box at the top of the Properties dialog says "Form" (your title bar should say "Section: Form").  On the "Data" tab, the Record Source should be the very first property.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 77

Expert Comment

by:peter57r
Comment Utility
Well there's nothing called  "referal information" in the code.

In design view, right click the button that gives you the problem and select properties.
Click the Other tab; note the control name.

Click the Event tab.
Click into the On Click property where it says [Event procdure].
Now click the Build button to the right.
You should go into the bit of code relevant to that button as described by Routinet.

You should be able to see the name of the form or report that is being opened.

Close the code window and the form.

In the database window try opening the named form or report by double clicking the name.

Pete
0
 
LVL 6

Author Comment

by:vand
Comment Utility
I have half a Gig of Ram.

The record source is blank for the form.



0
 
LVL 6

Author Comment

by:vand
Comment Utility
JimHorn, rebooting did not help.

BTW all the other "buttons" on this form work.  This problem is universal on multiple PCs.
0
 
LVL 6

Author Comment

by:vand
Comment Utility
There is no "control name" in the properties of the problem button.

The Code from the event procedure is the code I pasted in my original post!

The properties for command button:button0 are:

Under all

Name button0
caption Referral Information
picture none
picture type embedded
transparent no
default no
cancel no
auto repeat no
visible yes
display when always
tab stop
tab indexl
eft
top
width
height

on click event procedure

0
 
LVL 6

Author Comment

by:vand
Comment Utility
OK, when I double click on the form named "Main" I get the same error, also when I try to go into it's design view.
0
 
LVL 6

Author Comment

by:vand
Comment Utility
My "Main" form is corrupt. Replacing with a new copy fixed the issue.
0
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
Comment Utility
Still not enough info. Do this:
1. View the Startup form in design view.
2. Right click on the "referal information" button.
3. Choose Properties.
4. Click the "Other" tab.
5. The first item should be "Name". What is the value for "Name"? (Should be Command# or Button#)

0
 
LVL 6

Author Comment

by:vand
Comment Utility
Button0
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now