Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus after 3 forms
Message
From
01/03/2000 15:00:46
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00340014
Message ID:
00340031
Views:
27
>>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

in the second i have only one command button
In the command button's click event i have this code
do form form3

in the thirtd i have only one command button
In the command button's click event i have this code
do form form4

in the fourth i have one command button and one textbox
In the command button's click event i have this code
thisform.text1.setfocus

When i click this command button i recieve this error.
When i do this in the thirt form i dont recieve this error

Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform