Introduction
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
Overview
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.
Detail
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:-
Prettier?
Usage
Here is a sample Db for the above database
https://bytes.com/attachments/attach...ress-meter.zip
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
Phil