Chapter 24: Optimizing Access Applications ..............................................................................
843
- Any procedures that could be called by procedure B and procedure C are loaded, as well
as the entire modules containing those potential procedures. - And so on and so on....
Fortunately for all Access developers, this complete loading of a potential call tree has been
addressed in Access 2010. Access now automatically compiles modules on demand, instead of
loading the entire potential call tree.
Note
You can turn off the Compile on Demand option if you prefer, making Access compile all modules at one time.
You do this in the VBA program rather than in Access. (Access links directly to VBA’s development environ-
ment for working with VB code.)
To check the status of the Compile on Demand option, follow these steps:
- In the VBA editor window, choose Tools ➪ Options.
The Options dialog box appears.
- Select the General tab, and either check or uncheck the Compile On Demand check box
(see Figure 24.1).
FIGURE 24.1
For maximum performance, leave the Compile On Demand check box selected.
- Click OK.
With the Compile on Demand option selected, Access loads only the portion of the call tree
required by the executed procedure. For example, if you call procedure A in module A, any mod-
ules that contain procedures referenced in procedure A are loaded and compiled. However, Access
doesn’t take into consideration procedures that may be called from other procedures in module A,
and it doesn’t look at the potential call tree of the modules loaded because one of their procedures
is referenced in procedure A. Because Access loads modules one level deep from the executed