Defining the expression

A validation rule is a boolean expression. DataWindow Designer applies the boolean expression to an entered value. If the expression returns TRUE, the value is accepted. Otherwise, the value is not accepted and an ItemError event is triggered.

What expressions can contain

You can use any valid DataWindow expression in validation rules.

Validation rules can include most DataWindow expression functions. DataWindow expression functions are displayed in the Functions list and can be pasted into the definition.

For information about these functions, see the DataWindow Object Reference.

Use the notation @placeholder (where placeholder is any group of characters) to indicate the current column in the rule. When you define a validation rule in the Database painter, DataWindow Designer stores it in the extended attribute system tables with the placeholder name. At runtime, DataWindow Designer substitutes the value of the column for placeholder.

Pasting the placeholder

The @col can be easily used as the placeholder. A button in the Paste area is labeled with @col. You can click the button to paste the @col into the validation rule.

An example

For example, to make sure that both Age and Salary are greater than zero using a single validation rule, define the validation rule as follows:

@col > 0

Then associate the validation rule with both the Age and Salary columns. At runtime, DataWindow Designer substitutes the appropriate values for the column data when the rule is applied.