Hi,
I have a form with a control for the user to enter some data and then two command buttons 'OK' and 'Cancel'
For the OnExit event in the control I have a procedure that check the user input and if incorrect, opens a message box with an error message asking the user to correct the data. It then cancels the event so the focus remains in the current control.
However if the user presses the 'Cancel' command button on the form to cancel & close the form, the OnExit event for the current control still fires and askes the user to correct the data.
In my code in the control, how can I recognise that the Cancel command button has been pressed, so I can cancel the OnExit event and close the form?
THanks!
I have a form with a control for the user to enter some data and then two command buttons 'OK' and 'Cancel'
For the OnExit event in the control I have a procedure that check the user input and if incorrect, opens a message box with an error message asking the user to correct the data. It then cancels the event so the focus remains in the current control.
However if the user presses the 'Cancel' command button on the form to cancel & close the form, the OnExit event for the current control still fires and askes the user to correct the data.
In my code in the control, how can I recognise that the Cancel command button has been pressed, so I can cancel the OnExit event and close the form?
THanks!