Prev | Current Page 1617 | Next

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

"Access 2007 Bible"


SetPMeter i / lngCounter
The function SetPMeter consists of only three lines: one to display the rectangle and manipulate
its width, one to display the caption on the bar as it grows inside the rectangle in the form, and
one to repaint the screen each time so that the bar is animated.
Public Function SetPMeter(p As Single)
???p is percent of total
Me.PMeterBar.Width = p * Me.PMeter.Width
Me.PMeterBar.caption = Format(p, ???##%???)
Me.Repaint
End Function
Speeding up the progress meter display
This routine is called whenever you want to update the progress meter. You can decide when to do
this. Generally, you should call the progress meter only when it is likely to be updated. If you
know that you have 1000 records, you may call the meter every 10 records; if you have 10,000
records, you may call the meter every 100 records.
Although this code is simple, it is not the best option. In fact, because this code calls the progress
meter for every record, it is much slower than the built-in progress meter.


Pages:
1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629
rękawice rusztowania budowlane Kredyty samochodowe angielski Łódź spływy kajakowe