Chapter 24: Optimizing Access Applications
871
This progress meter has some advantages over the standard Microsoft Access progress meter. The
status-bar progress meter isn’t always as visible as you’d like. The status bar is always at the bottom
of the screen and is easily overlooked by a user, whereas the pop-up progress meter pops up in the
middle of the screen and is always visible to the user. Plus, the speed of the pop-up meter can be
controlled by updating the meter every x percent.
The progress meter form is created from a few simple controls. It contains a rectangle control, two
label controls, and option group controls. In Figure 24.12, the rectangle is showing 15 percent
completed. The width of the rectangle is manipulated by the program used to display the meter’s
progress. The width is reset to 0 when the progress meter starts, and it’s slowly built back to its
original length.
The code for the progress meter is shown in Figure 24.13.
FIGURE 24.13
The Progress Meter form call to the pop-up progress meter
The code that calls the meter is one simple line buried in the middle of the iteration loop, passing
the iteration number and total number of iterations expected. In this example, i is being processed
and lngCounter is 50,000.
SetPMeter i / lngCounter