>I have a loop which is executing a bunch of processes. I would like to drop on the form a button to stop it. Basically, what would be the best approach to have the button accessible during the process so I could stop what is being executed?
The easiest way to do this is to make sure you have DOEVENTS sprinkled through your code to give your form control to handle the Cancel button or whatever. You then need a flag in the executing code to make sure to let the process know that it's been cancelled and exit out after the next step/task.
Using a timer roughly has the same effect but is maybe a bit more work. In both cases you rely on the executing process yielding often enough to allow you to click the button. If you're stuck in the middle of some command though (like a long SQL command or report) this may not be possible.
+++ Rick ---