>HI friends:
>
>I have this problem.
>
>I've got a grid with a determined number of rows.
>
>When I'm on the last record empty field is allowed and valid returns "RETURN THISFORM.MYBUTTOM" because I want a confirm button has the focus after input a data or not (enter)
>
>The point is focus remains on textbox and valid is performed because I put code saying "I'm the valid method" and saying "Valid is done" but mybutton When event won't execute.
>
>What am i doing wrong or what is what I ignore about this?
>
>Thank you.
>
> Héctor
You can set the focus to the textbox using a timer. Put a timer on the form, Interval = 200, Enabled = .F.
In the Timer() event of the timer write:
THIS.Enabled = .F.
THISFORM.MyButton.SetFocus()
In the valid of the textbox, instead setting the focus to the button, just enable the timer:
THISFORM.tmrFocus.Enabled = .T.
HTH
Christian Isberner
Software Consultant