Solved

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

Posted on 2006-06-28
9
1,438 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
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 …

635 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