O'Reilly logo

Beginning Access™ 2007 VBA by Denise Gosnell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.1. Creating Modules

Modules are best described as containers for holding VBA code. Modules can contain declarations and procedures. VBA code that is placed in one or more modules can be called from an Access application to perform a specified task. I discuss this in greater detail throughout.

Figure 2-1 shows a sample module displayed in the Visual Basic Editor.

Note that the previous figure has four areas labeled. Each one will now be mentioned briefly.

  1. Object navigation box – Use to select the object to work with

  2. Declarations/Procedure navigation box – Use to navigate to the general declarations section or to a particular procedure

  3. Declarations – Contains the declarations for the module

  4. Procedures – Contains the sub procedures and functions for the module

Figure 2.1. Figure 2-1

When you select the Declarations/Procedure navigation box, a list appears that displays the existing procedures of the module, as shown in Figure 2-2.

Now that you have a basic idea of what a module is (container for code), let's turn to the different types of modules.

Figure 2.2. Figure 2-2

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required