Progress Indicator wanted

JohnPapa

Registered User.
Local time
Today, 02:08
Joined
Aug 15, 2010
Messages
1,117
I am developing an application where there is a lot of processing and the user may have to wait for 1-2 minutes sometimes 10 minutes for the result.

I could create a progress meter with a textbox which becomes bigger as time goes by etc.

Does anyone have a better idea or some example of a progress meter?

Thanks,
John
 
what's wrong with a simple text box that become bigger (I use it) ?
 
syscmd progress bar

Call SysCmd(acSysCmdInitMeter, "Progress .... ", y) y is the total size of the meter eg 100

Call SysCmd(acSysCmdUpdateMeter, x ) 'x is a numeric value representing the number of steps reached to date eg 24

Call SysCmd(acSysCmdRemoveMeter )


put syscmd in a code module and press F1 - you will get some good help
 
If you use SysCmd you can get the standard low-res progress bar. I used to do that but was not really satisfied. The bars didn't look pretty.

I now use two overlapping rectangles. One of them has a solid border and a transparent background. The other has no border but a solid-color background. I wrote three functions for progress-bar management.

One makes the bars visible, chooses colors, and makes their left ends, tops, and heights the same. This initializes the bar.

One makes them invisible (hides the bar). This is how the progress bar goes away.

The third makes the progress bar have a length L proportional to the current amount of progress. If you are at step S in a sequence that will have N steps, and if the progress bar will be W wide when at 100% completion, then the formula was L = W * S / N, and the value L goes into the .Width property of the bar that has a colored background. The W value comes from the .Width property of the bar that has a border but has the transparent background.

The answer L is in twips (since the length of the bar W is also in twips). That means you can get extremely fine resolution of the bar if you have lots of steps or, if the number of maximum steps is small, it just zips right along. You can also play games with the color palette of the background on the bar that is changing sizes so that it looks more interesting.
 
@The Doc Man:
why not posting it to the Samples db ;);)
 
All the methods I have seen require knowing the maximum number of steps involved prior to running the process.

If we have, say, a query that takes 2 to 10 minutes to run then we would need to know how many steps are involved to complete the run.
In essence the entire process needs to be divisible somehow.

So I think the first step is to find out if the process is divisible.

Chris.
 
I guess for non divisible progress the best will be to use something like the rotating globe only to show something is working
 
Well I have to say right up front I have not done this or even seen it suggested.

In terms of an indivisible query it should be possible to save, say, the number of records returned by the query the last time it was run.
On next run, use the last number as a guide and then save the number of records returned for next run. This makes the assumption that the criteria of the query doesn’t change but the number of records returned may vary over time. So perhaps a table of query names with the last number of records returned.

I have no examples available but it could make for an interesting project…for someone else. ;)

Edit
And on second thoughts that is not likely to work unless someone can find a way to 'cut in' to the query process.
That may also explain why I haven’t seen it done.


Chris.
 
Last edited:
this can work for a query using a recordset to add records to tables or thigns like that
 
Okay then, in this thread there is a progress bar.

It operates over a range of 0 to 1 as a floating point single.
It should be passed (current step) / (total steps.)

Usage example: -
Code:
Public Sub SmoothAllSeries(ByRef chtThisChart As Object, _
                           ByVal blnSmoothLines As Boolean, _
                           ByVal intSize As Integer)
                           
    Dim intSeries As Integer
    Dim intPoint  As Integer
    
    If (conHandleErrors) Then On Error GoTo ErrorHandler

    Application.Echo False
    
    DoCmd.OpenForm "frmProgressBar", OpenArgs:="Updating Chart Smooth Lines, please wait..."

    With chtThisChart
        For intSeries = 1 To .SeriesCollection.Count
            With .SeriesCollection(intSeries)
                .Smooth = blnSmoothLines
                For intPoint = 1 To .Points.Count
                    With .Points(intPoint)
                        .MarkerSize = intSize
                    End With
                Next intPoint
            End With
            
            Forms("frmProgressBar").UpdateProgressBar intSeries / .SeriesCollection.Count
        Next intSeries
    End With

ExitProcedure:
    Cleanup
    Exit Sub

ErrorHandler:
    DisplayError "SmoothAllSeries", conModuleName
    Resume ExitProcedure

End Sub

Maybe something to play with.

Chris.
 
Referring to Smig's comment above about a generic indicator like a revolving globe, in cases where the length of the process cannot be estimated, can someone point me to some generic progress indicators (with no percentage completion).
John
 
just use the hourglass

the other thing you could do is open a form with just a message on saying

"This process will take some time .. please wait patiently"

and close it on a timer.

doesn't need any clicks, and reassures the user it's doing something.
 
Or a combination of both ideas from gemma-the-husky.

I think the hourglass appears right in the center of the form so you can display a borderless form just below it (if you can).
 
sure, this is all possible and easy
thing is users got used to see moving objects :D
 
thing is users got used to see moving objects :D
They can continuously bang their heads against a brick wall if they want to see moving objects :D

You can use the form's TimerInterval to change the visibility property of a couple of images having different image positions or a textbox control using the Vertical Bar character or pipe character (as some may know it).
 
Well, we still don’t know what the process is but I doubt if the timer event would fire during an indivisible process and if the process is asynchronous the message may be canceled before the process finishes.

Perhaps the OP could tell us what the process is???
 
If it was a separate pop-up form for just displaying progress then it should continue running, however, it may interfer with the whole process because it seems the compiler tends to run a sort of thread (i.e. swapping between processes) between the form's timer and the running code. Just a guess!
 

Users who are viewing this thread

Back
Top Bottom