Kevin,
I'm all for code in one place only.
The problem with the Valid is you can't get out of it without testing for the escape key from the cancel button click.
>One technique is to have your cancel button, form.keypress and form.queryunload
>methods all call a single method, say 'FormClose'.
>
>Then you could test weather you want to close and return .T. or .F. to the
>calling method and still keep the controlling code in one place.