Prev | Current Page 1704 | Next

Michael R. Groh, Joseph C. Stockman, Gavin Powell, and Cary N. Prague

"Access 2007 Bible"


The following code and demonstration is contained in a form named frmSysCmdDemo
in the Chapter28.accdb database.
Use the acSysCmdInitMeter constant to initialize the meter. You must pass some text that is
used to label the meter as well as the meter??™s maximum value:
Private Sub cmdInitMeter_Click()
Dim vRetVal As Variant
MeterMax = 100
vRetVal = SysCmd(acSysCmdInitMeter, _
???Reading Data???, MeterMax)
End Sub
When this subroutine is run, the Access status bar appears, as shown in Figure 28-16.
FIGURE 28-16
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 28-17 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.


Pages:
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716
Paczatarez Ohyda Znaki szczególne Świat się pomylił Myslovitz