Chapter 24: Optimizing Access Applications
869
Using the built-in progress meter
In addition to using the hourglass, you should consider using the Access progress meter when per-
forming long routines in a procedure. The progress meter gives constant feedback that your appli-
cation is busy, and it shows the user progress in the current process.
On the CD-ROM
Chapter24.accdb illustrates two types of progress meters. The first is the standard Microsoft Access prog-
ress meter displayed in the Access status bar; the second is a colored rectangle displayed on a pop-up form.
The Chapter24.accdb sample database includes a number of forms which show the use of two types of
progress meters. Each uses a different type of progress meter but all run the same processing code. The code
creates a 50,000-record SampleData table, and the progress meters show the progress of the operation. Each
of the examples uses a simple form with several text-box controls and a button to start the process.
The following code demonstrates how to use the status-bar progress meter to show the meter start-
ing at 0 percent and increasing to 100 percent, 1 percent at a time. The first example is
ProgressMeterUsingBuiltInAccessMeter.
Caution
If you don’t display the status bar, you won’t see the built-in progress meter when it runs.
The code to initialize, update, and remove the meter is shown in Figure 24.10.
FIGURE 24.10
Code to run the status-bar progress meter