Solved

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

Posted on 2006-06-28
9
1,392 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

919 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

18 Experts available now in Live!

Get 1:1 Help Now