Understanding and Effectively Using Compilation Options
Microsoft Access gives you a few alternatives for compilation. Understanding them can help you to decide whether compilation speed or trapping compilation errors is more important to you.
Compile on Demand
By default, VBA compiles your code only when the code in the module changes or when a procedure in one module is called by another module. Although this default setting can dramatically speed the compilation process, it can leave you wondering whether you have a hidden time bomb lurking somewhere in your application.Here's a typical scenario: You open a form, make some simple changes, save the changes, and close the form. You repeat this process for a few additional forms. You also open a couple of modules to make some equally simple changes. During the testing process, you forget to test one or more of the forms and one or more of the modules. With the Compile On Demand option set to True (its default value), you won't identify the errors until your users access the offending code!To disable the Compile On Demand feature, choose Tools, Options from the VBE. Click the General tab and remove the check from Compile On Demand. You might notice some degradation in performance each time your code compiles, but this is time well spent.