Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to bypass Valid event
Message
From
05/11/2003 20:16:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00846883
Message ID:
00846886
Views:
17
>I usually verify each field after user entry by writing the logic in the VALID event.
>
>If the user decides to click the EXIT button, while the cursor and focus is on a field with a VALID event, the Valid event logic is executed before the focus goes to the EXIT button.
>
>Does anyone have a good way of bypassing this logic? Maybe by checking at the top of the VALID logic for some occurence that the EXIT button click caused?

Some alternatives are:

1) Put all the control logic in the Form.Save() method. Personally, I prefer this solution, since: a. it solves this particular problem, b. some values in different fields might be interdependent. And it is very easy to program.

2) Put the "Save" and "Cancel" commands in buttons in a ToolBar - outside the form. Thus, no TextBox.Valid() will be executed.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform