Microsoft KB Archive/282341

= ACC2002: &quot;Out of Memory&quot; Error Message in the Visual Basic Environment After You Open a Number of Modules =

Article ID: 282341

Article Last Modified on 11/6/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



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 &quot;Out of memory&quot; 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 &quot;Out of memory&quot; 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 &quot;Out of memory&quot; error message no longer appears.



Steps to Reproduce the Behavior
 Open a database that contains approximately 120 modules.  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  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 &quot;Symptoms&quot; section of this article. When you receive the error message, click End to stop the code. Try to manually open a few more modules from the Project Explorer. Note that you periodically receive the &quot;Out of memory&quot; error message. Modify the project in some way. For example, add some code to an existing module.</li> Save the project, and then quit Access.</li> Restart Access, and then open the database.</li> Press ALT+F11 to open the VBE. Note that the VBE loads, but that you still receive the &quot;Out of memory&quot; error message. From this point on, opening the VBE in this database results in the &quot;Out of memory&quot; error message, even though there are no open modules in the database.</li></ol>

Additional query words: pra

Keywords: kberrmsg kbbug KB282341

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.