Solved

Generic Progress Bar - for long-running events (queries, etc.)

Posted on 2006-06-28
9
1,398 Views
Last Modified: 2012-08-14
I have a few long-running events in my application (example:  building a 10-level treeview structure from 10 data tables.  Over our network, this task can take as long as 10-15 seconds to build for some conditions (which feels like an eternity) - I have played with indexing, with only minor improvement.  When run locally, from my disk, the tasks run much faster.

The only indication to the user that something is happening is the status bar at the bottom of the Access window, which is pretty dinky and not-so-obvious, and the hourglass.

I'd like to add a generic progress bar (or a pop-up) that would more clearly indicate that *something* is happening, and maybe describe the task.  I've seen similar things in other apps that run, but % progress is unknown (i.e., a repeatedly scrolling progress bar).

As the processes that are running are fairly CPU intensive, I do not want to add any significant burden or drag out execution time by any appreciable amount.

Any ideas how to present something to the user?
0
Comment
Question by:markp99
9 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17001904
u can use SysCmd to do it

an example can be found here

http://www.experts-exchange.com/Databases/MS_Access/Q_10169244.html
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 100 total points
ID: 17001931
when u build, its obviously in a loop

so see if u can build around that
Define a counter, though u really need to know the MaxValue, I guess a large dummy value would suffice if u dont knw


so to initialize the progress bar, setting explaining text and maximum value for the counter

Call SysCmd(SysCmd_InitMeter, "Text", MaxValue)


Setting the Progress bar using the counter value - increment countervalue in loop, remeber also to do  DoEvents

Call SysCmd(SysCmd_UpdateMeter, CounterValue)

then when done remove the progress bar when finished

Call SysCmd(SysCmd_RemoveMeter)
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17001951
The other option is to create a popup form

then in your counter, update the value or something in the popupform
then refresh that form

Docmd.openform "myPopup"

do ... loop here

    do somethng
    forms!mypopup!counter = somevalue

done

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 26

Assisted Solution

by:dannywareham
dannywareham earned 100 total points
ID: 17002368
0
 
LVL 34

Assisted Solution

by:jefftwilley
jefftwilley earned 100 total points
ID: 17002420
0
 
LVL 58

Assisted Solution

by:harfang
harfang earned 100 total points
ID: 17003198
Hello markp99

Since you have nothing to display in way of progress, what you are really looking for is an animation.

An animated gif on a popup form would be ideal, but I can't seem to display animations on forms. You would have to build the form with WinAPI calls (much like the "copy file" animation).

In pure access, you would use a popup form with a timer event, for example set to run two or three times a second. In that event, you can manipulate the size of a rectangle, move something around on your form, or even create a crude animation using image objects (for example six hidden images, and your timer event will show them one at a time).

The good thing about the timer event is that every thing happens almost as if it ran in a separate thread. The bad thing is the "almost". Some operations take too high a priority and even prevent the timer of a form to do any animation, and the screen won't refresh.

But it's worth a trial.

(°v°)
0
 

Assisted Solution

by:cesemj
cesemj earned 100 total points
ID: 17010204
Hello,

I have used the following below as reference to help me use a popup form to track the progress of an FTP download and Db data refresh.  It is not pretty, but it worked.  But, I wouold go with Mr. Harfang concepts, they have helped me in the past.

1. Go to MVP Sandra Daigle's site for some working examples:
http://www.daiglenet.com/msaccess.htm 
(Download Progress Meter 2.0)

Poor Mans Method
**************
2. For a detailed visual walk-through guide, see this link:
http://www.datapigtechnologies.com/flashfiles/progressbar.html 

cesemj :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dsum Function for List Box Data 7 43
MS Access - need to reduce row size 25 51
Question about DB Schema 27 50
Column Layout in Access Xp VBA Report 3 18
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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 …

813 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

10 Experts available now in Live!

Get 1:1 Help Now