Hi João
>I have a form with one TextBox, one Buttom CmdSearch, when i go to click in CmdSearch the TextBox Valid event takes control, and i can´t go anywhere,
> Any trick here?
Try puting on the method Gotfocus a variavel to control the value, and then on the valid check if is diferent from the original value ...
Method GotFocus ....
OldValue = This.Value
Method Valid ...
if This.Value = OldValue
Return
Endif
... rest of the code to validate
> Is there any way to send the focus automaticly to the TextBox that i leave?
(i have several textbox, it could be TextBox1, TextBox2....)
Use again the method GotFocus. On the Method GotFocus, save the name of the control, and then when you restore to the last control only have to can him back.
Method GotFocus ....
ControlFocus = This.Name
Methid Click in Search_Button
Do .... <
>
ldummy = ControlFocus +".SetFocus"
&ldummy
NOTE: the best way is creating a textbox class and a form class for both examples.
HTH
Nuno Brito
Nuno Brito