>In many situations, I'll want a user to stay in the current field until they enter a valid value - OR - until they press the CANCEL button! I know that I can keep them in the field by returning .F. in the VALID method, but how can I account for that CANCEL button?
>
>TIA
If your Cancel button has Cancel=.T. then Lastkey() will return 27 when the button is pressed, just as if the user pressed Esc.
So put
IF LASTKEY()=27
return .T.
endif
in your Valid event