Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Applicable sequence of events to trap empty text box on
Message
From
21/10/2003 13:28:12
 
 
To
21/10/2003 10:41:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00840665
Message ID:
00840738
Views:
25
Hi, Andrew-

>What would be an effective and efficient way to branch code execution in the following scenario;
>
>Textbox1 on form1
>
>Lookup for possible values for textbox1 on form2
>
>If textbox1 is empty, abandon new record, *unless* form2 has gotten focus, ie: user wishes to lookup value for form1.textbox1 using form2.
>
>I already have the code for EMPTY(this.value) on form1.textbox1.lostfocus. Where could I test for form2.gotfocus()?

Activate() and Deactivate() are the methods that correspond to GotFocus and LostFocus. However, the problem in your scenario is that the TextBox Valid and LostFocus will fire before Form1.Deactivate and Form2.Activate. So, you have a catch-22.

It's much cleaner, and more common, to call the lookup form from the valid, or lostfocus of the TextBox if the value is empty. Or, from what you've described, it sounds like they will have to select an existing value, so wouldn't a combobox work?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform