5.1. Anatomy of the VBA Editor

You can access the VBA Editor in several ways. From anywhere in Microsoft Access, click Alt+F11 on the keyboard or choose Tools, Macro, Visual Basic Editor. You can also enter the VBA Editor from any Form or Report. From the Properties dialog box, click the Events tab, select the event 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 you see on the screen. Let's view the VBA Editor within a user-created module, as shown in Figure 5-1

The VBA Editor shown in the figure has the following components:

  • Project Explorer: This window shows you all of the components of the current VBA Project. The various components can include three types of objects: form or report modules, class modules, and standard modules. Each type of component has its own icon. The Project Explorer in Figure 5-1 contains a class module, a source form, and a standard module. The VBA Project carries the same name as the current database. If for any reason, the Project Explorer isn't visible when you display the VBA Editor, click Ctrl+R to display it.

  • Properties Window: This dialog box, typically shown on the bottom-left corner of the VBA Editor, lists all of the properties for the currently selected object. The object could be a module or a class module. You probably won't use the Properties window often when writing VBA code in Access 2003. This window ...

Get Access 2003 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.