Use a Cancel button only with windows that use an OK button. A cancel operation should allow the user to close a window without being subjected to any “side effects” of the window’s dismissal. Typically, this means that no warning dialogs should appear asking whether the user wants to save changes, nor should any requests appear that the user provide more information prior to the window closing.
In addition, observe the following guidelines when adding a Cancel button:
The following Cancel button script in the RM_Aging window simply closes the RM_Aging form:
close form RM_Aging;