Solved

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

Posted on 2006-06-28
9
1,385 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

707 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

12 Experts available now in Live!

Get 1:1 Help Now