Make sure that your Cancel button have Cancel = .T.
In you txtBox.Valid(), put this:
IF LastKey() <> 27
ENDIF
HTH
>I have a form with a text box that is looking for the user to enter a customer number. The text box is validated with my database to make sure the customer number exists. I also have a cancel button on the form. When the form is instantiated the focus is set to this customer number. If they decide they don't want to enter this screen and press cancel the validation kicks in and say the customer number is invalid (nothing entered). This is good unless they were trying to hit the cancel button. Is there a way for me to know that they were pressing the cancel button and the validation should return .t.?