Cancel / stop command?

option

Registered User.
Local time
Today, 16:39
Joined
Jul 3, 2008
Messages
143
Hey guys,
I'm trying to build a cancel option into my database that would stop whatever code is being worked "dead in its tracks" so to speak. I've searched for examples, but nothing relevant appears in the searches. Any ideas how I could pull this off??
 
There has been some coding posted in this forum for using the Esc key to break into loops. You might search for that.
Private Declare Function apiGetAsyncKeyState Lib "user32" _
Alias "GetAsyncKeyState" _
(ByVal vKey As Long) _
As Integer

Good luck
 
Hey guys,
I'm trying to build a cancel option into my database that would stop whatever code is being worked "dead in its tracks" so to speak. I've searched for examples, but nothing relevant appears in the searches. Any ideas how I could pull this off??

Vonnie: are you saying that the escape key is being used as a "break point"? If so, thats not going to cancel the operation, but merely pause it and we don't want the user interfering with any of the code. Thanks though :). I've tried sendkeys using Ctrl + Break, but that doesn't work. The process that I am running is quite lengthy, and if it is going take longer than the time the user has available, we want to be able to hit cancel or stop and have the program stop what its doing. I don't want to close the form because there are other processes that can be run besides the one in question.
 
If you capture the ESC key, then you can do whatever code you want at that point - you don't have to let them into the coding. You want to stop the coding but not have the user involved at all, is that it? You stop code execution and then what?
 
If you are in the middle of a routine the END keyword ends the routine.
It doesn't even go to the End Sub
 
Wayne & Vonnie, thank you both for all of the help! I've got my project back on track and its thanks to you!
 
Mind you that DoEvents slows your program down quite a bit, so be carefull when you use them.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom