Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private mblnCancel as boolean
Sub cmdLoopIt_Click()
cmdLoopit.Enabled = false
cmdCancel.Enabled = true
' Must not reach here twice
Do While (mblnCancel = false)
DoEvents
Loop
cmdCancel.Enabled = false
cmdLoopit.Enabled = true
mblnCancel = false
End Sub
Sub cmdCancel_Click ()
mblnCancel = true
End Sub
' You can also use the same button
Private mblnCancel as boolean
Private mblnBusy as boolean
Sub cmdLoopIt_Click()
if mblnBusy then
mbnlCancel = true
cmdLoop.Enabled = false
cmdCaption = "Wait"
exit sub
End if
mblnBusy = true
cmdLoopit.Caption = "Cancel"
' Must not reach here twice
Do While (mblnCancel = false)
DoEvents
Loop
cmdLoop.Caption = "Loop"
cmdLoop.Enabled = true
mblnCancel = false
mblnBusy = false
End Sub
Do While(frmSearch.mblnCancel = false)
........
Exit Do
Loop
Do While(mblnCancel = false)
DoEvents
if mblnCancel then exit do
Read
if eof then exit do
...process
Loop