>I need to SetFocus back to the textbox after it losses it focus when it's empty. I try setting enable = .F. for all other controls but it's not very good idea for my task. However the SetFocus won't work in Valid, compared to Init.
>
>Thanks in advance.
>
>Gan
Gan,
You've received plenty of good advice on how to achieve a specific goal. Another approach would be to place all your validation rules in a hook, just before saving the record.
My Save() method goes like this:
IF BeforeSave()
the usual Save here
ENDIF
Then the BeforeSave()
IF !Rule for field 1
Find the offending control
put its back color in flamant red
set the focus to it
send a warning message
RETURN .F.
ENDIF
etc...
José