
Note To have a Cancel button cancel all the actions that have taken place in a form or dialog box, you need to write a macro or event procedure and attach it to the OnClick property of the button.
For a form that allows irreversible operations, such as deletions, it's a good idea to make the Cancel button the default command button. To do this, set both the Cancel property and the Default property to Yes.