ACC2002: "Out of Memory" Error Message in the Visual Basic Environment After You Open a Number of Modules (282341)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q282341
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

On a computer that is running Microsoft Windows 98, Microsoft Windows 98 Second Edition, or Microsoft Windows Millennium Edition (Me), when you open a database that contains approximately 120 modules, you receive an "Out of memory" error message. However, the Visual Basic Environment (VBE) still opens.

RESOLUTION

If you modify the database project and then save and close the project, the "Out of memory" error message no longer appears the next time that you open the database. To modify the database project, follow these steps:
  1. Open the database.
  2. Open a module in Design view.
  3. Modify the project in some way. For example, add some code to the open module.
  4. Save the project, and then quit Access.
  5. Start Access, and then open the database again. Note that the "Out of memory" error message no longer appears.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open a database that contains approximately 120 modules.
  2. Create a new module, and then type or paste the following code:
    Sub OpenMod()
    
        Dim c As VBIDE.VBComponent
        For Each c In VBE.ActiveVBProject.VBComponents
            c.CodeModule.CodePane.Show
        Next
     
    End Sub
    					
  3. Run the code. This procedure tries to open every module in the database. Note that after a number of modules are opened, you receive the error message that is mentioned in the "Symptoms" section of this article.
  4. When you receive the error message, click End to stop the code.
  5. Try to manually open a few more modules from the Project Explorer. Note that you periodically receive the "Out of memory" error message.
  6. Modify the project in some way. For example, add some code to an existing module.
  7. Save the project, and then quit Access.
  8. Restart Access, and then open the database.
  9. Press ALT+F11 to open the VBE. Note that the VBE loads, but that you still receive the "Out of memory" error message. From this point on, opening the VBE in this database results in the "Out of memory" error message, even though there are no open modules in the database.

Modification Type:MajorLast Reviewed:11/6/2003
Keywords:kbbug kberrmsg KB282341