I have a VBA/Database program that aquires data from an instrument via the serial port while controlling a function of that instrument. The program will control the instrument, take a reading, control it, take a reading until it gets a satistfactory result.
It works great unless the user messes up and does something with the instrument during the process or disconnects a signal source to the instrument, or just plain bumps something.
My program will continue to adjust the instrument and take readings past a point that it knows to stop. You can see the instrument continue to change on its screen and even my form seems to have recovered. But the code is still operating in the background!
If I bring up the code module and click on the "STOP" button on the second row tool bar, the code stops and I can manually restart the test.
Is there a button I can put on my form that can allow the user to stop the code module from running? What VBA command can stop code running in a loop?
Thanks much.
It works great unless the user messes up and does something with the instrument during the process or disconnects a signal source to the instrument, or just plain bumps something.
My program will continue to adjust the instrument and take readings past a point that it knows to stop. You can see the instrument continue to change on its screen and even my form seems to have recovered. But the code is still operating in the background!
If I bring up the code module and click on the "STOP" button on the second row tool bar, the code stops and I can manually restart the test.
Is there a button I can put on my form that can allow the user to stop the code module from running? What VBA command can stop code running in a loop?
Thanks much.