Progress Bars and Microsoft Access

(Updated 2010-09-27)

Syscmd

The syscmd progress meter in the status bar is way too small for most people to notice.  It was a decent size in A2.0 but no more.  ACC2000: How to Use the Status Bar Progress Meter - 210474

Progress Bar Control

The ProgressBar control is subject to all the versioning problems of any control especially a Microsoft control and very much especially COMCTL32.OCX.

Using a form

The advantage to using a form is the increased flexibility.  You can size and colour it to suit your whims.

HOW TO: Simulate a Progress Bar in a Form Without Using an ActiveX Control in Access 2002 - 304581 is Microsoft's sample code.

So I create two rectangles. A larger one named boxProgressBar.   A smaller one called rectProgressBar just inside the the larger box.  It's sized just a bit smaller. Change the Back Colour of the front rectangle to whatever you wish and the Back Style from Transparent to Normal. You might want to change the Etched special effect of the front one to Flat.

Then change the following sample code to suit.

Dim intCurrentProgress As Integer
' This is the number of objects you expect to count which take some
'   time to process.  It likely won't be a constant in your environment.
Dim intTotalWidth As Integer
Const intProgressBarMax As Integer = 20

intTotalWidth = Me.boxProgressBar.Width

For intCurrentProgress = 1 To intProgressbarMax
    Me.rectProgressBar.Width = (intTotalWidth / intProgressBarMax) * intCurrentProgress
    Me.Repaint
Next intCurrentProgress

[ Access Tips | AccessMain ]

Auto FE Updater   Auto FE Updater distribute new and updated Front End databases to your users with several mouse clicks.

Wrench and gear Granite Fleet Manager - the best designed fleet maintenance tracking and management system available

Comments email Tony  Search Contact Tony's Blog Privacy Policy Table of Contents

Website copyright © 1995-2013 Tony Toews