How To Skip the Validation of a Control and Exit the FormLast reviewed: October 17, 1996Article ID: Q150752 |
The information in this article applies to:
SUMMARYIn some cases, it is necessary to exit a form even if the data in a given control does not meet the validation rules in the Valid method. To make this behavior possible, testing is done for some specific condition by stopping the code in the Valid Method from being evaluated. This article describes how to release a form by clicking a command button even if the data in the Textbox control is not valid.
MORE INFORMATIONThe following example shows that by testing for the mouse position relative to the Exit Command button, the Tab key, and the Enter key, the code skips around the validation. Text1 Valid method contains an IF ELSE statement where the IF portion tests a special condition, and the ELSE portion does the validation. When the ELSE portion is skipped, other controls get focus and the form is terminated. The special condition is an attempt by the user to exit the Text1 field while the mouse is positioned on top of the exit button. The TAB and ENTER keys are also part of that special condition because, by default, they also cause the focus to move to another object. NOTE: For this behavior to work, the ScaleMode of the form is set to 0- Foxels.
Steps to Create Example
|
Additional reference words: 5.00 3.00 3.00b VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |