Progress bar

Chimp8471

Registered User.
Local time
Today, 05:05
Joined
Mar 18, 2003
Messages
353
one or two of my queries seem to take a while to complete, so i was hoping to use some kind of progress bar to highlight how much of the query has completed.

i have searched through the forums to try and find a very simple guide to using the progress bar that is built in access activex control.

is there a idiots guide to setting one of these up please

Andy
 
I never liked the built-in Access progress bar so I always rolled my own.

Imagine, if you will, TWO rectanges of identical dimensions. One colored (.backcolor) something dull, the other colored something bright. Overlapping on the form, with the bright bar on top. Aspect ratio very long but very narrow, looks like a long horizontal bar.

When you are about to start, make both rectangles visible, make the top and left and height properties of the bright one match the named properties of the dull rectangle, but make the width of the bright one equal to 1 and leave the width of the dull one whatever it is. I don't think you CAN make it 0, but heck, you could try. At worst it wouldn't work.

Now, at the places in your code where you would updated the progress bar, you compute a ratio of how much you have done to the expected number of things to do. This is going to be a real number 0.xxxxx from 0 to 1.0000, and that is exactly how you need it.

Take this fraction-of-completion number. Convert the width of the dull rectangle to a real number and compute the completion ratio times the width. Convert that result back to an integer. Store that number in the width property of the bright rectangle. Repaint the screen. You'll see a sliding bright bar moving left to right, overlaying a darker bar. You can put both bars anywhere on your form that is convenient.

If you have a lot of things to do, it will be a smoother slide. If you have very few things to do, it will be jumpy. But from your comments, it sounds like you might have a lot to do.
 
cheers, that was really helpful....i think i get you, have you got any examples ?
 
Sorry, I'm at a military site. Can't release any code from here without going through more hoops than a Barnum & Bailey tiger.
 
ok cool, i understand......i will have a play and see what i come up with

Andy
 

Users who are viewing this thread

Back
Top Bottom