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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel out of a routine which calls other routines 1

Status
Not open for further replies.

wusinik

Programmer
Jul 12, 2001
20
US
I am tring to have an option available to users so that when a user hits a command button which triggers a long process, a "cancel" button can be available so that they can go back to the main form. I'm having trouble truly exiting out of the routine b/c the routine which sends the time-consuming process off calls other routines... any ideas??
 
Maybe have a boolean variable named bCancelled, and before every line of your code in the one button do a

Code:
DoEvents
If not bCancelled Then
code

Then inside the Cancel Button just set bCancelled=True

It's kinda ugly, but it works.

Kevin



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top