Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need to create a progress meter while an Access module runs

6 views
Skip to first unread message

Brent E

unread,
Jan 28, 2005, 2:55:02 PM1/28/05
to
Good morning,

I am using an Access VBA module w/ several sub procedures to perform several
functions, and I would like a message box w/ a progress meter to pop up to
inform users of that module's progress. I experimented w/ using a syscmd
function to display a meter in bottom of window, but I recently read in a
book that I can create a form and use that as a pop up meter? But directions
aren't specific. Is this correct, and how do I run a progress meter on a
form, or is there a built-in function provided by windows to make a pop up
progess box? (Similar to progress meter windows shows when files are being
copied). Any suggestions would be appreciated. Thanks.

Cordially,
Brent

Jeff Conrad

unread,
Jan 28, 2005, 3:14:08 PM1/28/05
to
Hi Brent,

A few options for you:

Go to MVP Sandra Daigle's site for some working examples:

http://www.daiglenet.com/msaccess.htm
(Download Progress Meter 2.0)

For a detailed visual walk-through, see this link:

http://www.datapigtechnologies.com/flashfiles/progressbar.html

And here is a past post on this subject by Sandra herself:
>>>
I suggest avoiding the ActiveX control because of the issues that arise when
dealing with ActiveX's. Instead you might want to consider using the
built-in Progress meter or build your own.

Following is a simple example of how to use the system progress meter - look
down in the lower left corner to see it working. Create a form with a single
button, then paste this code into the Click event procedure for the button.
Basically you initialize the progress meter with a number that represents
how many intervals there are, then you make successive calls to update the
progress meter with an incremental value. Finally you remove the meter. My
example shows it as used in a looping procedure but you can also adapt this
to a lengthy linear list of tasks.

You can create a more noticable progress meter by using a rectangle control
which you color based on the degree of completion of the task. My example of
this is on www.daiglenet.com/msaccess.htm.

There is also a chapter in the Access Cookbook by Ken Getz, Paul Litwin, and
Andy Baron which describes how to make a reusable progress meter. You can
read this excerpt online at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnac...

FWIW, I also like using the progress meter control from the FMS product
Total Access Components 2000. It has a richer set of features and can be
displayed anywhere on the form. (www.fmsinc.com).

Private Sub Command12_Click()
Dim inti As Integer
'
' Initialize the progress meter
Application.SysCmd acSysCmdInitMeter, "Doing Stuff", 10000

For inti = 1 To 5000
Me.txtCounter = inti
'
' Increment the progress meter on each iteration
Application.SysCmd acSysCmdUpdateMeter, inti
' Occasionaly yield CPU to the OS so other stuff can happen
' the 77 is an arbitrary number - you can tune this however you
' want. You can leave this whole if...then out if you just want the loop
' to have all CPU till
' it is done
If inti Mod 77 = 0 Then
DoEvents
End If
Next inti
'
' Remove the meter
Application.SysCmd acSysCmdRemoveMeter


End Sub


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
>>>

Hope that helps to give you some ideas,
--
Jeff Conrad
Access Junkie
Bend, Oregon

"Brent E" <Bre...@discussions.microsoft.com> wrote in message
news:1F291847-88F1-4DBB...@microsoft.com...

Brent E

unread,
Jan 28, 2005, 4:11:05 PM1/28/05
to
Terrific, Thanks Jeff. I think that's exactly what I was looking for, have a
terrific weekend my friend.

Jeff Conrad

unread,
Jan 28, 2005, 4:38:41 PM1/28/05
to
Excellent, glad to help Brent!
I hope you have a terrific weekend as well.

--
Jeff Conrad
Access Junkie
Bend, Oregon

"Brent E" <Bre...@discussions.microsoft.com> wrote in message

news:1686B84B-470A-471A...@microsoft.com...

Brent E

unread,
Jan 28, 2005, 5:51:04 PM1/28/05
to
By the way, u seem very knowledgeable. Thanks again for the assistance. If I
get stumped on a really difficult Access problem, do u mind if I email u? I
can be contacted at COMPASS...@yahoo.com. If that's ok w/ u, please send
me a quick email and I will add u to my reference address list. Thanks again.

Brent

Jeff Conrad

unread,
Jan 28, 2005, 6:25:28 PM1/28/05
to
"Brent E" <Bre...@discussions.microsoft.com> wrote in message:
news:DEB58A49-5A6E-482E...@microsoft.com...

> By the way, u seem very knowledgeable.

It's all done with smoke and mirrors Brent.
Sort of a "Wizard of Oz" thing.
<vbg>

> Thanks again for the assistance.

No problem.

> If I get stumped on a really difficult Access problem, do u mind if I email u? I

> can be contacted at <e-mail snipped>. If that's ok w/ u, please send


> me a quick email and I will add u to my reference address list. Thanks again.

The best way to reach me Brent is right here. Serious. If you post questions
to the newsgroups you will have the help of thousands of knowledgeable
people from all over the world!! You can't beat that. Plus my schedule can
vary widely so that doesn't help you. Best to take full advantage of the NGs.

0 new messages