ACC2000: Visual Basic Editor Displays Hidden Modules (210181)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q210181
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

After you hide a module in the Microsoft Access Database window by setting its Hidden property, you can see the module in the Project Explorer in the Microsoft Visual Basic Editor.

CAUSE

The Hidden property hides objects from view only in the Access Database window. The Visual Basic Editor provides no mechanism for hiding individual modules in the Visual Basic project of a database.

MORE INFORMATION

You can set the Hidden property for modules to keep them from appearing in the Access Database window. However, the Visual Basic Editor does not respect this property, and shows all modules.

Steps to Reproduce Behavior

  1. Create a new Microsoft Access database or Microsoft Access project.
  2. On the Tools menu, click Options.
  3. Click the View tab and click to clear the Hidden Objects check box.
  4. Click OK to close the Options dialog box.
  5. Create a new module and save it as modTest.
  6. Switch to Access (press ALT+F11).
  7. Right-click the modTest module and click Properties
  8. Click to select the Hidden check box, and then click OK.

    Note that the modTest module is no longer listed in the Database window.
  9. Switch to the Visual Basic Editor (ALT+F11).

    Note that the modTest module is listed in the Project Explorer window.
  10. Right-click the modTest module, and click Hide. This action hides the code; modTest remains visible in the Project Explorer window, but the code is not viewable in the Code window. This is similar to closing the module window.
  11. In the Project Explorer window, double-click modTest to unhide the code.

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kbprb KB210181