4.1. Anatomy of the VBA Editor

You can access the VBA Editor in several ways. From anywhere in Microsoft Access, press Alt+F11 or choose from several places on Access's new Ribbon: Create, Macros, Modules, Database Tools, or Visual Basic. You can also open the VBA Editor by double-clicking a module name in the navigation pane or from any form or report. From the Properties dialog box, click the Events tab, select the event that you're interested in, click the Ellipses button (. . .), and choose Code Builder. When you first view the VBA Editor, you might be a little overwhelmed by the number of components on the screen. Take a look at the VBA Editor within a user-created module, as shown in Figure 4-1.

The VBA Editor has the following components:

  • Three types of modules: Form or report modules, class modules, and standard modules. Each type of component has its own icon. The Project Explorer in Figure 4-1 contains a class module, a source form, and a standard module. The VBA project carries the same name as the current database. If the Project Explorer isn't visible when you display the VBA Editor, press Ctrl+R to display it.

Figure 4.1. Figure 4-1
  • The Properties window: Typically shown in the bottom-left corner of the VBA Editor, the Properties window lists all properties for the currently selected object. The object could be a module or a class module. The Properties window is ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.