Event fired when an attempt is made to close the form; return value determines if the form can be closed.

Parameters

none

Property of

Form, SubForm

Description

Use canClose to prevent a form from closing until certain conditions are met.

The canClose event handler can either return a value of true, which allows the form to close, or false, which prevents the form from closing.

When a form is closed by calling close( ) or clicking the Close icon, pending changes in the data buffer are saved. When attempting to close, the form fires the current control’s valid event, if any, so there’s no need to verify individual controls if they have valid event handlers. However, you should always perform form- or row-level validation to check controls that you have not visited.