When defined, it provides control over what happens when the data entry operator tries to stop data entry by pressing the ESC key, the
Stop button, Ctrl+S, or attempting to exit data entry. When any of the above events occur, the
OnStop function is executed, with no stop dialog (discard, save, cancel) appearing.
The
OnStop function can be used to prevent the operator from stopping data entry (
see Example 1 below) or to allow stopping data entry only under certain conditions (
see Example 2 below).
Be aware that if you have added an
OnStop function to your data entry application, then when a partial case is resumed, no resume dialog ("Do you want to go to last...") appears. Therefore if you wish for this feature to be available to your interviewers, you must code it yourself (
see Example 3 below).
Similarly, if special actions are required when resuming a partial case, check whether a partial case has been entered by using the
ispartial function, and then add the appropriate logic.
The
OnStop function is not executed when the
stop function is executed.
As mentioned above, when OnStop is defined in an entry application, you must write your own logic to resume from a partial save. However, this is only possible in one-level applications, as the name and occurrence number of the last field entered is not retrievable in two-level entry applications.