Solved

Progress Bar on form while a macro is running

Posted on 2006-06-13
8
464 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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
 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

816 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

8 Experts available now in Live!

Get 1:1 Help Now