Previous Page
Next Page

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.

Image from book
Figure 2-1

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

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.

Image from book
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.


Previous Page
Next Page