asnyc? progress bar?

G

Guest

Hi,

I am using MS ACCESS 2003.
I placed MS Progress Bar Control 6.0 over the form.

When event is fired, progress bar has to be working. When another event is
fired,
the progress bar will be stop. BTW, PB is the instanace of the progress bar
control.

Dim currentWorking as Boolean

Private Sub Do()
Start ' it invokes StartProgress method

.....
...

End ' it invokes EndProgress method

End Sub

Private Sub StartProgress()
currentWorking = True
While currentWorking
PB.Value = i
i = i + 1
If i > PB.Max Then
i = 1
End If
Wend
End Sub

Private Sub EndProgress()
currentWorking = False
End Sub

Actually I thought.....vb event is async, so...
As long as currentWorking is True, progress bar will be updated, once
another event is invoked to EndProgress, currentWorking will be False, so
progress will be stop......However, it wasn't.... it goes to infinitely
looping..

How do I modify above code to work as I expected in vba?

Thanks.

...............................................................TJ
 
A

Albert D. Kallal

I would dump the use of the progress bar unless YOU REALLY REALLY REALLY
REALLY REALLY desperate to use it.

In other words, after exhausting every other resource, consulting with your
teams of developers, and doing everything possible to avoid using the
progress bar, then, and only then if you have no choice, then use the
progress bar.

The problem here is that you are using a activeX control. That means:

1) you have to have the developers edition of the progress bar installed
on your computer. Simply *copying* the progress bar .dll to another computer
WILL NOT ensure that it runs (activeX controls have had a licensing feature
built in for 10 years now. If you install Joe accounting software, and it
has progress bar control, you can 'not copy it..and you will get a "no
license error". So, you need a developer tool that supplies, and comes with
the progress bar control. And, the standard, and even the professional
edition of office with ms-access DOES NOT come with the progress control.
So, you can't legally (and in technically either) copy this control to
another computer and expect it to work.

2) An activeX control needs to use the windows installer to setup,a nd
"install" the control. Since you are NOT using a windows installer, you
can't ensue that the target computer where you run your application will
have the progress bar control installed. If you are not using some install
scripts to setup, register, and use the progress bar control on the target
computer, you will have NOTHING BUT INSTALLING problems

3) If the control is missing, then you will have a broken reference, and all
kinds of simple functions like Left$, right$ etc will break. You open a big
can worms by committing to activeX controls here...

If you are a good developer, then I am sure all of the above issues were
long ago dealt with, and are of little concern to you now. However, if ANY
of the above issues is even SMALL surprise, then I would avoid the activeX
control if possible (as mentioned, I saying "if" possible. If you absolute
need it, then do feel free to use it, but just take into the above issues).

I simply wrote my own progress bar, and made it look like the windows one.
You download my "super easy word" merge here:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

There is a form in the above that uses my own progress bar..and you might
find it better suited for your purposes as it is ms-access form.

There is a LARGE number of ms-access progress bars out there..but NONE
looked anything remotely like the windows progress bar..so, I wrote my own,
and you can find a version in the above word merge example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top