Full Version: Poor Man's Progress Bar (Mike Alexander's)
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
mmadani
I have replicated the progress bar form with not much luck. The bar runs quickly behind the query result set window. so the user will not see the gradual progress. What am I doing wrong.

Here is the code:

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

DoCmd.SetWarnings False
Dim stDocName As String

stDocName = "C1"
DoCmd.OpenQuery stDocName, acViewNormal

Me.Lbl1.Visible = True
Me.Lbl2.Visible = True
Me.PROGRESS.Caption = "20%"
DoEvents
Me.Lbl3.Visible = True
Me.Lbl4.Visible = True
Me.PROGRESS.Caption = "40%"
DoEvents
Me.Lbl5.Visible = True
Me.Lbl6.Visible = True
Me.PROGRESS.Caption = "60%"
DoEvents
Me.Lbl7.Visible = True
Me.Lbl8.Visible = True
Me.PROGRESS.Caption = "80%"
DoEvents
Me.Lbl9.Visible = True
Me.Lbl10.Visible = True
Me.PROGRESS.Caption = "100%"
DoEvents


DoCmd.SetWarnings True

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
confused.gif confused.gif
accesshawaii
Mike, what you're doing isn't going to be an actual representation of the progress. Check out this posting.
mmadani
Check out this example. The author says that it works. It looks real good to me, but I do not see a query launch at all. It is in the code. see the link and let me know. Clever ideas

http://www.datapigtechnologies.com/flashfi...rogressbar.html


Thanks for your time.
accesshawaii
I just looked at progressbar example, it's a real arachaic kind've way to do it. It's all hard-coded plus the example is using "DOCMD.OpenQuery" and turning the system warnings off, which is not an advisable way to do it. It's also not going to be a true representation of the progress. It's all hard-coded for each individual query, all queries are not going to take the same amount of time to process.

If you want a true representation of the progress then use the link I provided but if you're just looking for something to display that's really not going to be accurate for the progress then you can go with that example. One piece of advice though, instead of using "DOCMD.OpenQuery" method, use CurrentDB.Execute
mmadani
Dan;

Thanks for looking at that. I agree with you. My point is , as he describes the DOCMD.OpenQuery, you never see the query run or any results after that Even when the progress bar reaches an end.

If I try to replicate this Fake Progress bar (Let's Say) my query launches and covers the progress bar form. It does not work like his. Try it for kicks and giggles if you have a spare 5 minutes. I would seroiusly think it should launch the query, as it is not running hidden.

I am not sure how to make yours work. I wanted to launch a long query (or short) have the progress bar advance in real time or close to it, close the progress bar, and have the query display its results.

I would like to see the components of your progress meter or if you can attach the DB so I can see the results or how you did that.

Thanks

Mo
mmadani
Dan;

Also I tried CurrentDB.Execute , and it errored out as it will not run with a Select query.
accesshawaii
Well, select queries, you don't run, they're not action queries.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.