ACC2000: Database Window Doesn't Display Modules Inserted from Text in VBE

ID: Q223209


The information in this article applies to:

Moderate: Requires basic macro, coding, and interoperability skills.

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


SYMPTOMS

When you insert a module from text in the Visual Basic Editor (VBE), the module does not appear in the Microsoft Access Database window.


CAUSE

You have not saved the Visual Basic project of the database. The Database window in Access displays only saved modules.


RESOLUTION

Save the Visual Basic project of the database. To save the Visual Basic project of your database, follow these steps:

  1. In Microsoft Access, press ALT+F11 to open the Visual Basic Editor.


  2. On the File menu, click Save Project Name.



MORE INFORMATION

Access displays only saved modules in the Database window, even though the Visual Basic Project Explorer can display new, unsaved modules. This occurs because Access is unaware of the new module until you save the Visual Basic project of the database. After you save the project, the Visual Basic Editor notifies Access of the modules currently stored in the project.

Steps to Reproduce Behavior

Create a Text File to Import

  1. Open the sample database Northwind.mdb.


  2. Press ALT+F11 to open the Visual Basic Editor.


  3. On the View menu, click Project Explorer.


  4. Expand the Modules node under the Northwind project node to view the modules in the project.


  5. Select the Startup module.


  6. On the File menu, click Export File.


  7. Select the default name Startup.bas, and then click Save.


  8. Press ALT+F11 to switch to Microsoft Access.


  9. Close the Northwind database.


Import the Text File

  1. Create a new, blank database.


  2. Press ALT+F11 to open the Visual Basic Editor.


  3. On the File menu, click Import File.


  4. Select the Startup.bas file that you saved in step 7 of the "Create a Text File to Import" section, and then click Open.


  5. On the View menu, click Project Explorer.


  6. Expand the new database project node in the Project Explorer.


  7. Expand the Modules node to view the modules in the project. Note that the Visual Basic Editor Project Explorer displays the newly imported Startup module under the Modules node.


  8. Press ALT+F11 to return to Microsoft Access.


  9. Click Modules under Objects, in the Database window.


Note that Microsoft Access does not display the Startup module in the Database window.

Additional query words: prb


Keywords          : kbdta PgmOthr UiDbwin 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 25, 1999