Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

Progress Bar on form while a macro is running

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
jetera
Asked:
jetera
  • 3
  • 3
  • 2
1 Solution
 
jefftwilleyCommented:
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
 
rockiroadsCommented:
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
 
jeteraAuthor Commented:
Thanks, I can't do it - the second answer did not work either.
Too bad!
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
rockiroadsCommented:
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
 
jefftwilleyCommented:
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
 
jeteraAuthor Commented:
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
 
jefftwilleyCommented:
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
 
rockiroadsCommented:
jetera, no problems

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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now