Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not executing code in the lostfocus of a textbox
Message
From
20/03/1998 14:11:06
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00086068
Message ID:
00086077
Views:
18
>>I have some field level validation that I do when the user enters data into a textbox. I put this validation in the lostfocus.
>>
>>1) But I don't want this code to execute if the user clicks on the restore toolbar. How can I detect for the user hitting an object outside this form and not execute the stuff in the lostfocus. Should this code even be in th lostfocus to start with or the valid ??
>>
>>2) i fthe user hits enter I want the user to stay in the current textbox if data entered fails that test, but still allow them to exit out of the screen (cancel out so they are not trapped in this field)
>
>Here is the sequence of the applicable events fired when clicking on an object while focus is on a different object:
>
>Object1.Valid
>Object2.When
>Object1.LostFocus
>Object2.GotFocus
>
>Since the second object's When is fired *before* the first object's LostFocus, you can programmatically check in the first object's LostFocus if the second object was selected (setting a logical property flag in the second object's When, perhaps?).
>
>Just one idea.
>
Sorry, Bryan. It works when objects are on the same form and user clicks. It doen't work for tabbing within the same form and doesn't work at all when objects are on different forms.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform