Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with KeyPress
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00452358
Message ID:
00452395
Views:
24
In version 5, VFP was changed so that you can not call SetFocus from the When or Valid methods of any controls. What you can do is move the Valid code to the LostFocus event. You can make those calls from there.

>>In order fot the Valid of the textbox to fire, an attempt has to be made to make it lose focus. The On Key Label is not making that happen.
>>A better way (IMO) to design this would be to have a SaveMethod at the form level. That method could validate each control. It could also SetFocus to the Save button to make the textbox's value get written to the controlsource.
>>F8 could call the SaveMethod and so could the Click method of the Save button.
>
>Larry,
>
>Thank you...
>
>I can't belive why SETFOCUS can't call in Valid Event...
>
>If it's possible, all the problems will solver...
>
>And.. I'm trying to make this work, but all that I do is wrong... Error 2012 always appear.
>
>Thank you.
>
>Rodolfo Duarte
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform