At the top of your valid event, put If LastKey()=27; Return. Ensure your cancel button has Cancel set to true.
>i have a form that has textboxes and commandgroups on it. one textbox is a reference box which needs a valid reference, that is working (i use the valid event). but my problem is if this box has the focus and i try to abort the entry by clicking on a cancel button, the valid of the textbox still runs which i want to stop.
>
>can any one help?
>
>thanks
>
>
>daryl