Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus after 3 forms
Message
 
To
01/03/2000 15:00:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00340014
Message ID:
00340065
Views:
26
>>>I have a command button i a form.
>>>This form is my fourth open form.
>>>In the click events i have this code
>>>thisform.text1.setfocus
>>>
>>>After clicking this command button i recieve this errormessage:
>>>Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event (Error 2012)
>>>
>>>1 - I have not used the setfocus method within a When, Valid, RangeHigh or RangeLow event
>>>2 - When this form is the third form i dont recieve this error.
>>>Thanks.
>>
>>Cemal, did you try to trace it and track the events in both cases?
>>
>>Nick
>Hi Nick,
>
>To understand the error i have created a new project with 4 new forms
>
>In the first form i have only one textbox
>In the textbox's valid event i have this code
>do form form2
>

IMHO, in any case the somecontrol.Valid() event is not the right place to launch the form.
Try to put it in LostFocus() or think of other better place for it.
Even if you call two other methods from Valid event and the last method does .SetFocus() you will get that error.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform