>Hi. VFP6 user here. I am having trouble placing the user back in the current field when my data validation fails. Fox doesn't like SetFocus in the valid, and it doesn't seem to work for me in the LostFocus.
>
>For Example (in LostFocus)
>IF ! "Dr" $ This.Value
> =messagebox('This list should be Doctors only.',16,'Go Back')
> This.SetFocus
>ENDIF
>
>...doesn't work
>
>Thanks, Randy
Move it to .Valid() method like this:
*Valid() method
IF ! "Dr" $ This.Value
=messagebox('This list should be Doctors only.',16,'Go Back')
RETURN 0
ENDIF
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison