Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I interrupt an running application?

Status
Not open for further replies.

sdillard

Technical User
Oct 23, 2001
32
US
My once my application starts, is there a way to kill it no matter what it is doing via a button? I put a Cancel button on it that sets a CancelFlag and my app is processing while CancelFlag is false, but nothing happens when I press it.
 
You will need to put a DoEvents in the "Loop"(s) that is not giving up control. Be sure (by Enabled=False) that the user can't re-initiate the process that has the the DoEvents while you are in the DoEvents.
Private m_intDoEvents as integeer ' Module level variable
If m_intDoEvents count > 1000 ' or whatever
m_intDoEvents = 0
DoEvents ' Give Cancel a chance
End If
m_intDoEvents = m_intDoEvents + 1 Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top