Event fired when an attempt is made to navigate in a table; return value determines if the record pointer moves.

Parameters

<workarea expN>

The work area number where the navigation is attempted.

Property of

Form, SubForm

Description

The form’s canNavigate event is used mainly for form-based data handling with tables in work areas. It also fires when attempting navigation in the form’s primary rowset.

Use canNavigate to prevent navigation until certain conditions are met. Navigation saves pending changes in the data buffer, so you should call row- or form-level validation in the canNavigate to make sure data should be saved.

Because canNavigate fires while still on the current record, you may also use it to perform some action just before you leave. In this case, the canNavigate would always return true to allow the navigation.

When using tables in work areas, canNavigate will not fire unless the form is open and has controls dataLinked to fields. For example, if you USE a table, create and open an empty Form, assign an canNavigate event handler, and SKIP in the table, the canNavigate will not fire simply because the form is open.

When attempting navigation in the form’s primary rowset, the form’s canNavigate fires before the rowset’s canNavigate, and the <workarea expN> parameter is zero. If the form’s canNavigate returns false, nothing further happens; the rowset’s canNavigate does not fire, and no navigation occurs.