That's because LastKey() doesn't change until you type something. Try this to clear the value from LastKey():
IF LastKey() = 27
KEYBOARD CHR(255)
INKEY()
RETURN .T.
ENDIF
HTH
>thanks. i tried it and it works, but if i click elsewhere on the form it bypasses the validity check on the text box, maybe i put it in the wrong spot?