Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement