>Hi All,
>
>If data entered in a combo box is not valid, how should I set cursor staying in the combo box until it is valid.
>
>I used the following code in the Valid method:
>
>If !SEEK(code, "codetable")
> wait window "Not valid code"
> RETURN .F.
>ENDIF
>
>I thought if I use RETURN .F. the cursor will not leave but it does not work. Could anybody tell me why?
>
>Jim
Try replacing your valid method with...
if not SEEK(this.value, "codetable")
=MESSAGEBOX( "Invalid code",0,"Input Error")
return(0)
endif