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
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