Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 24: Optimizing Access Applications


849


Even on computers with large amounts of installed memory, loading both the compiled and
uncompiled versions of modules takes more time than loading compiled modules alone.

There is one drawback to compiled applications: They use a bit more hard drive space than their
decompiled versions because both the compiled and decompiled versions of the code are stored on
the hard drive.

Hard drive space shouldn’t often be a problem, but if you have an application with an enormous
amount of code, you can save hard drive space by keeping it in a decompiled state. Remember that
a trade-off is made between hard drive space used and the performance of your database. Most
often, when given the choice, a user would rather give up a few megabytes of hard drive space in
exchange for faster applications.

Tip
You can use this space-saving technique to your advantage if you need to distribute a large application and
your recipients have a full development version of Access. By distributing the uncompiled versions, you need
much less hard drive space to distribute the application, and the end users can compile it again at their loca-
tion. If you’re going to do this, you should put the entire application into a decompiled state. I cover fully
decompiling an application in the “Using the decompile option” section, later in this chapter.


Putting your application’s code into a compiled state
You have only one way to put your entire application into a compiled state: In the VBA editor win-
dow, on the Modules toolbar, choose Debug ➪ Compile Database Name (see Figure 24.4). You must
have a module open to access the Debug menu. Generally, you should always use the Compile
Database Name command to ensure that all the code is saved in a compiled state. Complex applica-
tions may take a long time to compile, and, in general, you may choose to compile your Access
projects only before distributing to end users or before performing benchmark tests.

FIGURE 24.4

Compile Database Name is the only way to fully compile your application.

Free download pdf