What is the best way to provide the user with a stop button? This isincase the code gets stuck in a loop, not from programming error necassarily but from external influence.
For example the program controls an instrument which responds, your program takes a reading and tells the instrument to adjust slightly and then takes another reading, etc. In my case, my program is doing a two point calibration on an electroni instrument, so there is a lot of back and forth adjusting of a low end control and a high end control until they are both perfectly balanced. I had an instance where I bumped a control on the instrument while this rouinte was running, the routine never recovered and stuck in this calibration loop. I had the code envirement loaded so all I had to do was clcik the "STOP (.)" button. The end user, typically, would not have this luxury. I found the STOP statement brings up the code environment and that is not desireable, I am not sure what it would do if compile to an MDE statement.
I have put in a tries counter that allows the program to "give up" after a while, but that may not be ideal.
Of course a close form button stops execution, but then the user will loose data collected on the screen before having a chance to save it.
What is normally done in Access VBA for an E-STOP button?
For example the program controls an instrument which responds, your program takes a reading and tells the instrument to adjust slightly and then takes another reading, etc. In my case, my program is doing a two point calibration on an electroni instrument, so there is a lot of back and forth adjusting of a low end control and a high end control until they are both perfectly balanced. I had an instance where I bumped a control on the instrument while this rouinte was running, the routine never recovered and stuck in this calibration loop. I had the code envirement loaded so all I had to do was clcik the "STOP (.)" button. The end user, typically, would not have this luxury. I found the STOP statement brings up the code environment and that is not desireable, I am not sure what it would do if compile to an MDE statement.
I have put in a tries counter that allows the program to "give up" after a while, but that may not be ideal.
Of course a close form button stops execution, but then the user will loose data collected on the screen before having a chance to save it.
What is normally done in Access VBA for an E-STOP button?