dbTalk Databases Forums  

Progress meter wanted

comp.databases.ms-access comp.databases.ms-access


Discuss Progress meter wanted in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JohnP
 
Posts: n/a

Default Progress meter wanted - 02-18-2011 , 03:29 AM






I am developing an application where there is a lot of processing and
the user may have to wait for 1-2 minutes sometimes 10 minutes for the
result.

I could create a progress meter with a textbox which becomes bigger as
time goes by etc.

Does anyone have a better idea or some example of a progress meter?

Thanks,
John

Reply With Quote
  #2  
Old   
stefan
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 03:53 AM






Hi John,
in VBA you can use the syscmd-method:
for example you define the progress meter with

varReturn = SysCmd(acSysCmdInitMeter, "Statusbar Text", 100)
for a process with 100 steps;

then you show the progress with
varReturn = SysCmd(acSysCmdUpdateMeter, 1)
varReturn = SysCmd(acSysCmdUpdateMeter, 2)
and so on for each step of your process;

at the end of your process you clear the status bar with
varReturn = SysCmd(acSysCmdSetStatus, " ")

grts
Stefan

Reply With Quote
  #3  
Old   
JohnP
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 05:28 AM



Stefan,
I used the following

Dim lngCounter As Long
Dim varReturn As Variant
varReturn = SysCmd(acSysCmdInitMeter, "Updating ...", 1000000)
For lngCounter = 1 To 1000000
varReturn = SysCmd(acSysCmdUpdateMeter, lngCounter)
Next
varReturn = SysCmd(acSysCmdClearStatus)

nothing seem to happen and varReturn always seem to have an "empty"
value.

Any ideas,
John

Reply With Quote
  #4  
Old   
Jon Lewis
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 07:08 AM



John

You have to have the Status Bar being displayed within your current database
to see the progress meter.
The code works for me. You may have simplified your code for your post but
you do realise that normally you would update varReturn from within your
process so that the progress bar actually reflects the progress of your
process?

HTH

"JohnP" <john (AT) kosmosbusiness (DOT) com> wrote

Quote:
Stefan,
I used the following

Dim lngCounter As Long
Dim varReturn As Variant
varReturn = SysCmd(acSysCmdInitMeter, "Updating ...", 1000000)
For lngCounter = 1 To 1000000
varReturn = SysCmd(acSysCmdUpdateMeter, lngCounter)
Next
varReturn = SysCmd(acSysCmdClearStatus)

nothing seem to happen and varReturn always seem to have an "empty"
value.

Any ideas,
John

Reply With Quote
  #5  
Old   
John Spencer
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 08:08 AM



Former MVP Sandra Daigle has a nice selection of Progress Bars and forms:
http://www.accessmvp.com/SDaigle/ProgressMeter.ZIP
There is also one at Arvin Meyer's website:
http://www.datastrat.com/Download/ProgressBar2K.zip

WARNING: I haven't visited either of those recently, so the URL may be invalid.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 2/18/2011 4:29 AM, JohnP wrote:
Quote:
I am developing an application where there is a lot of processing and
the user may have to wait for 1-2 minutes sometimes 10 minutes for the
result.

I could create a progress meter with a textbox which becomes bigger as
time goes by etc.

Does anyone have a better idea or some example of a progress meter?

Thanks,
John

Reply With Quote
  #6  
Old   
stefan
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 08:12 AM



Hi John,

I use this for processing recordset rs_kopf:

rs_kopf.MoveLast
varReturn = SysCmd(acSysCmdInitMeter, "PL läuft ... ", rs_kopf.RecordCount)
rs_kopf.MoveFirst
varReturn = SysCmd(acSysCmdUpdateMeter, rs_kopf.AbsolutePosition + 1)
While Not rs_kopf.EOF
....
rs_kopf.MoveNext
Wend

Reply With Quote
  #7  
Old   
stefan
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 08:14 AM



Hi John,
I use this for processing a recordset rs_kopf:

rs_kopf.MoveLast
varReturn = SysCmd(acSysCmdInitMeter, "processing ... ", rs_kopf.RecordCount)
rs_kopf.MoveFirst
varReturn = SysCmd(acSysCmdUpdateMeter, rs_kopf.AbsolutePosition + 1)
While Not rs_kopf.EOF
....
rs_kopf.MoveNext
Wend

grts
Stefan

Reply With Quote
  #8  
Old   
JohnP
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 10:25 AM



John Spencer,
The links you gave me would solve the problem nicely.

Jon Lewis,
How do you enable the status bar within the db?

Thanks for your replies and Stefan's,
John

Reply With Quote
  #9  
Old   
Jon Lewis
 
Posts: n/a

Default Re: Progress meter wanted - 02-18-2011 , 11:51 AM



It's a selectable setting and depends on the version of Access. e.g
2007 Access Options>Current Database>Application Options>Display Status
Bar

Earlier versions I think it's on the Tools>Options dialogue from memory

HTH

"JohnP" <john (AT) kosmosbusiness (DOT) com> wrote

Quote:
John Spencer,
The links you gave me would solve the problem nicely.

Jon Lewis,
How do you enable the status bar within the db?

Thanks for your replies and Stefan's,
John

Reply With Quote
  #10  
Old   
JohnP
 
Posts: n/a

Default Re: Progress meter wanted - 02-20-2011 , 03:26 AM



Thanks Jon,

In Access 03 which I use is under Tools > Options > View

I am leaning towards creating my own progress bar. The sysCmd progress
bar is not very visible and the status bar occupies screen space.

John

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.