422,172 Members | 2,196 Online
Bytes IT Community
Submit an Article
Got Smarts?
Share your bits of IT knowledge by writing an article on Bytes.

A Better Progress Bar

Expert 100+
P: 1,052

Frequently with Access databases a process takes a certain amount of time to complete, such as updating a large number of records, or reading information from the internet.
Panic sets in. Has the program crashed?

The usual technique is to show the status bar moving on at the bottom of the screen. However, I feel that this is frequently not seen, and gives very little information about what the progress actually is. In addition, while you are waiting for the process to complete, itís nice to have something pretty to look at.

So I came up with this floating form:-

which I call ProgressMeterRainbow

The top line tells us what it is doing - in this case translating.
Second line a bit more information that it is translating from English to Mongolian.
The third line informs us that there are 463 words to translate and on the forth line we find that 308 words have been translated (67%) as seen on the bottom line.
This last line (subject to the words fitting on it) shows the English word and (hopefully) the Mongolian equivalent.

There are a number of parameters that need setting up, obviously more than on the standard Access Progress bar.
The parameters that can be changed are the start and end colour of the bar. In this example we go from Red to Green, obviously the 5 titles, and the detailed information displayed.
The Progress Meter needs to know how many records it has to process (Often found by moving to the end or a RecordSet and retrieving the RecordCount) and how many records have been processed.

Below is a picture of a sample Db to show the parameters that can be enterd:-



Here is a sample Db for the above database


I am not going to go into the code because it is reasonably obvious from the sample database.

Briefly, you need to get the total of the number if items to be shown (Often RecordCount)
Open the Progress Meter
Then we set the titles, speed & colours required.
Then we loop round reading each record and increment a counter and display whatever information is required about the record.
Finally we close the ProgressMeter.

The Progress Meter is not restricted to counting records. It can be used for anything where the total number of items to be processed is known, and there is a method of counting the items as they are dealt with.

Hope this may be of use

Attached Images
File Type: png ProgressBar.png (7.9 KB, 477 views)
Feb 15 '18 #1
Share this Article
Share on Google+
1 Comment

Expert Mod 100+
P: 2,112
Beautiful! Great job, Phil!
Feb 15 '18 #2