Chapter 26: Bulletproofing Access Applications
919
FIGURE 26.14
The progress meter after initialization
Incrementing the meter is a little tricky. In the following subroutine, the global variable MeterInc
is incremented by 10 and the meter’s position is set to the value of MeterInc.
Private Sub cmdIncrementMeter_Click()
Dim vRetVal As Variant
MeterInc = MeterInc + 10
vRetVal = SysCmd(acSysCmdUpdateMeter, MeterInc)
End Sub
Figure 26.15 shows the progress meter after five increments. It’s easy to see that the meter has
moved a distance proportional to the value of MeterInc after being incremented five times.
FIGURE 26.15
The progress meter midway in its movement
You’ll have to choose values for the progress meter’s maximum and increment settings in your
application. Also, be sure to update the progress meter at appropriate intervals, such as every time
one-tenth of a process has run (assuming, of course, that you know ahead of time how many items
will be processed or how long an operation may take).
A meter is a valuable way of keeping the user informed of the progress of a lengthy process.
Because you control its initial value and the rate at which it increments, you’re able to fairly pre-
cisely report the application’s progress to its users.
The only issue with the default Access progress meter is that it appears at the very bottom of the
screen and is easily overlooked by users. Also, if the status bar is hidden through the Display Status
Bar option on the Current Database tab of the Access Options dialog box (refer to Figure 26.7), the
progress meter can’t be seen at all.
Tracking down problems
So you’ve developed your great application, deployed it to all the users, and everyone’s happy
using it. Not that I’m suggesting you didn’t do a good job developing the application, but it’s possi-
ble (in fact, likely) that one or more users may get errors when using the application. When that
happens, it’s useful to have some techniques to help determine what went wrong.