By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

A Better Progress Bar

Expert 100+
P: 1,430

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 14 '18 #1
Share this Question
Share on Google+
6 Replies

Expert Mod 2.5K+
P: 3,210

First, very impressive! I, too, like to include progress meters when Access is doing something with a series of records or values (or even sorting, for that matter). Obviously you have put a lot of thought into creating a customizable display for any possible application.

For my tastes though, (and please don't take this as a knock against your Progress Meter), it does seem to overly complexify what can be a very simple addition to any form that runs through a series of values.

Attached is a very simple Form, demonstrating the Progress Bar I use on my forms. This can be used almost anywhere, and only requires a few extra lines of code, and three additional objects on a Form. In theory, this could also easily be adapted as a pop-up Form displaying in the foreground, but I tend to want it residing on the Form doing the work.

Again, this is not intended as a "nit-pick" of your article. Based upon your forum responses and the sample DBs you have provided in the past, you are way ahead of many people's games in terms of "thinking outside the box" and finding solutions to everyday problems. However, sometimes we need to remember to "keep it simple". How can we guide novices into good practices at a level of expertise they can readily understand and execute?

Your progress bar is definitely "Better"! And I will probably have a need for such a thing in the future, so I have saved it. And, for those who are ready for it, your code provides the opportunity to grow in a deeper understanding of Access/VBA and helps to make a boring DB visually interesting.

Thank you for your contribution (and your ongoing contributions to this forum). You are a treasure of knowledge and experience that benefits us all!
Attached Files
File Type: zip Progress (20.1 KB, 37 views)
Feb 14 '18 #2

Expert 100+
P: 1,430
Thanks for response and kind words.

Actually I was trying to publish this as an article rather than a question in response to Seth & your requests, but obviously, as usual, I got it wrong.

Nice & Simple.

Much depends on the info you want to display, and whether you need a popup box.

On my translator program where I translate a whole database into currently 7 languages, as you can imagine it takes an hour or two to do the initial translation, so it is quite useful to see which language it is working on and how far through it has got.

So enjoy using it, and if I find out how to publish an article, I have quite a number if what I think are quite useful little forms / routines.

Feb 14 '18 #3

Expert Mod 2.5K+
P: 3,210

Go here (or just click the Articles Tab, once you get to the Access/VBA Forum).
Feb 14 '18 #4

Expert 100+
P: 1,430
The here link works.

I went to Articles on the top black box, then the blue Submit an article which seemed logical but it actually goes to the Question Page.

Should I just copy the post as an article now that I can see how to do it?

Feb 14 '18 #5

Expert Mod 2.5K+
P: 3,210
I “think” if I were a mod, I could move it for you.....
Feb 14 '18 #6

Expert Mod 15k+
P: 31,419
I assume you're happy that the second version is fully acceptable? PM me if you have any worries.

Twinny's right in that, were he a mod, he'd have been able to move it across for you. That would have been the most appropriate action (Obviously a PM or Skype to me rather than Twinny).

Unless I hear to the contrary I'll assume you're happy with what's posted in the Insight forum. I know I am. Good work Phil.
Feb 16 '18 #7

Post your reply

Sign in to post your reply or Sign up for a free account.