|
-
May 13th, 2000, 03:25 AM
#1
I have an app where a lengthy procedure is being run in a module while the results are being written to a form with a cancel button. When the user clicks cancel, I want to stop executing the sub in the module.
Is there any way to unconditionally break the execution of a procedure from another form?
Essentially, I want to inject an "exit sub" unconditionally at whatever point the sub is at.
Any help would be appreciated.
John
-
May 13th, 2000, 03:44 AM
#2
take a look on 'DoEvents' in the VB documentation.
best regards
-
May 13th, 2000, 06:17 PM
#3
Frenzied Member
the only way to do this perfectly would be to multi thread but that's far more hassle than it's worth, have a look at the doevents, and have a booloean variable called boolKeepRunning, get your cancel button to set boolKeepRunning to False, and after your doevents code put If Not boolKeepRunning Then Exit Sub
hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|