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.




Beginning Access 2007 VBA
Beginning Access 2007 VBA
ISBN: 0470046848
EAN: 2147483647
Year: 2004
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net