Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2007

Tip: Looking for answers? Try searching our database.

Progress bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Silvio - 01 Jan 2007 17:28 GMT
How can I concatenate the status bar to my progress bar? Rigt now the progres
bar runs and then displays the query results. In few words, the progress on
my form does not reflets the actual progress % like the one in the status
bar. I did read several comments in this forum on progress bar, however I
think I am missing out the main thing: how to link the progress bar to the
actual opreation time when run a query or a report that takes several second
to make the calculation and then  display. Any idea?

Dim inti As Integer
   Dim dblPct As Double
   Me.txtPctComplete.Visible = True
   Me.boxWhole.Visible = True
   Me.boxPct.Visible = True
   
   Do Until inti > 500
       dblPct = inti / 500
       Me.txtPctComplete = dblPct
       Me.boxPct.Width = Me.boxWhole.Width * dblPct
       DoEvents
       inti = inti + 1
   Loop

Me!frmReport.Form.Requery
Me.Caption = "Reports Menu"
HiTechCoach - 01 Jan 2007 18:49 GMT
A progress bar does not show the "actual opreation time" but the steps
completed.

To use a progress, you need to have some VBA code performing a loop.Within
you code look, you will update the progress bar. You can not insert code to
update you progess bar within an action query or opening a report.

>How can I concatenate the status bar to my progress bar? Rigt now the progres
>bar runs and then displays the query results. In few words, the progress on
[quoted text clipped - 20 lines]
>Me!frmReport.Form.Requery
>Me.Caption = "Reports Menu"

Signature

Boyd
Hi Tech Coach
http://www.hitechcoach.com

Marshall Barton - 01 Jan 2007 18:50 GMT
>How can I concatenate the status bar to my progress bar? Rigt now the progres
>bar runs and then displays the query results. In few words, the progress on
[quoted text clipped - 17 lines]
>        inti = inti + 1
>    Loop

I have never heard of a way to retrieve the status bar info
for an autonomous operation such as a query.  OTOH, if you
are using SysCmd to control the status bar, then you know
the values it is displaying.

That seems to be rather obvious so I suspect your question
is really about how to get the form's control to display in
sync with the loop.  Drawing the form on the screen is a
separate task (from your code execution task) that runs at a
lower priority so it normally lags behind what you would
expect if everything were single threaded.  Unfortunately,
syncing these tasks often takes a somewhat mysterious
incantation of statements.  With luck, using Me.Repaint is
sufficient, but sometimes, as you are doing, DoEvents is the
magic word.  There seem to be times when the Repaint needs
to be followed (and maybe even preceded) by DoEvents.  If
all those fail to produce the desired effect, the last
resort is to add additional DoEvents statements or just
chalk it up as one of those situations beyond human
comprehension.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.