Solved

Progress Bar on form while a macro is running

Posted on 2006-06-13
8
462 Views
Last Modified: 2010-05-18
Hi everyone,
I have searched the board for how to make a progress bar run on a form - and I can do it when I am looping through records.  But now I have the simplest form with one button on it 'cmdrun' that runs on macro that is a series of queries.
Does anyone know how I can make the progress bar run with the macro?  The macro takes a while to run.

Thanks,
Jetera
0
Comment
Question by:jetera
  • 3
  • 3
  • 2
8 Comments
 
LVL 34

Accepted Solution

by:
jefftwilley earned 250 total points
ID: 16895397
Here's a good discussion on the topic. Might answer your questions.
http://www.experts-exchange.com/Databases/MS_Access/Q_21812357.html?query=progress+bar&topics=39
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16895417
By macros, your not talking VBA code, but proper macros

well u could try this


Add this code into a vba module


Public Function UpdateStatusBar(ByVal sText As String)
    Application.SysCmd acSysCmdSetStatus, sText
End Function


Now in your Macro, add steps whereby you Run Code, select this function
And argument to this is some text u want displayed

0
 

Author Comment

by:jetera
ID: 16895716
Thanks, I can't do it - the second answer did not work either.
Too bad!
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16895802
What didnt work?

Did it not update the status bar?

If it didnt work or u cant do Jeff's suggestion, why did u close this question?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 34

Expert Comment

by:jefftwilley
ID: 16895851
There is another option as well...and that's to take the number of queries that you have, and break up your 100% width of your progress bar into #queries/100 widths. Then each time a query finishes, call a function similar to Rocki's that will push your progress bar out to the next width. It's not a proper progress bar, but it will simulate progress between each query in your macro.
ex:
Say you have 5 queries. After the first query runs, move your progress bar out 20% of the total width. After the next, push it out another 20%...until you get to 100.

J
0
 

Author Comment

by:jetera
ID: 16896073
I closed the question because I want a real status/progress bar.  Sorry - I didn't realize it everyone had more to say.  I needed a quick answer and something quick to try and I didn't get what I wanted.  Then I read the link that jefftwilley put and it answered my question.  What else can I do now?

0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 16896284
Here's a good thread with the same discussions.
http://www.experts-exchange.com/Databases/MS_Access/Q_21875686.html
It kind of describes different options besides a true recordcount based progress bar. I've never had much luck with them other than Rocki's suggestion using the sysmeter commands. But you can try to throw up some kind of splash or interesting thing to watch. Just be sure to use a DoEvents somewhere inside your macro to let other things run while your queries run.
J
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16897904
jetera, no problems

I just asked based on your last post, when u said nothing seemed to have work but you closed it.

0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now