422,754 Members | 2,297 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,116

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

Feb 15 '18 #1
Share this Article
Share on Google+

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

P: 35
The link doesn't seem to be working...has it been removed or is my equipment faulty...(good thing my wife isn’t unable to answer)
1 Week Ago #3

Expert 100+
P: 1,116
Someone has committed a Cardinal sin and needs keel hauling. I haven't a clew what has gone wrong, but here is the link again.

Phil (regrettably having to sell my boat)
Attached Files
File Type: zip Progress Meter.zip (1.63 MB, 11 views)
6 Days Ago #4

P: 35
It worked that time, thanks. I have office 365 at home and somehow the version of Access is 64 bit and I am too lazy to convert it...so...it will have to wait until I get to work on Monday since that is where I intend to use it.

Someone has committed a Cardinal sin and needs keel hauling.
A sad but common occurrence in my life! My sailing days are over as I have retired from the Navy but the memories shall linger forever...

Edit: I have always been impressed by individuals who have managed to figure out Class Modules. I have tried for over a year to
1. Figure out how to do them
2. Find a true utility for them.

I did manage to find a very appropriate situation to use one but if it had not been for a very similar existing Module available on the internet, I would still be sorting it out. What can I say, I simply and NOT a programmer.

I cant wait to get to work on Monday and put this to use. Very impressive and thanks again for sharing.

6 Days Ago #5

P: 35
I was able to run it at work with no issues. The processes in need to incorporate are slightly more complex than stepping through a record set - this will work perfectly though.

Very well written and documented. Excellent work!
4 Days Ago #6