>Hi all,
>
> I have a textbox in my form, and i have written validations on that, but i want if it returns false value, it should remain in that field only. But if i do it in valid event, it does not allow me to do anything, i must write valid value in that. i cannot press cancel button also, or i cannot open another form for master entry etc.
>
> If i written code like if value is false then 'this.setfocus()' But it doesnot sets the focus to the same field
>
>PLEASE HELP
>
>TIA
>Amit
If your cancel button has it's cancel property set to .T., then it also set LASTKEY() to 27 when it is clicked. This menas you can code your valid event like:
IF LASTKEY() <> 27 AND (SomeCondition)
RETURN .F.
ENDIF
Erik Moore
Clientelligence