Solved

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

Posted on 2006-06-28
9
1,412 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

685 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