Page 28 of 31PREVNEXT

Combo boxes, list boxes, and other controls

Validation Rule Validation text
<>0 Please enter a nonzero value.
0 or >100 Value must be either 0 or over 100.
<#1/1/2000# Enter a date before 2000.
>=#1/1/2004# and <#1/1/2005# Date must be in 2004.
Not "myself" Please enter your name.

Validation rules warn users against mistakes before data is entered in a form.

For example, if you don't ship your product to a particular state, you could create a rule against entering that state in a shipping form.

Validation rules should be created with caution and forethought. If you don’t foresee all the possibilities, you might prevent someone from entering data that is actually valid.

To apply a validation rule to a control on a form, you would select that control in Design view, click the Properties button Button image, and then click the Data tab. You could enter a simple rule, like those shown in the table, in the Validation Rule property box.

Clicking in that box would cause three dots to appear next to it, and clicking those would open the Expression Builder dialog box. You could use the dialog box to create more complex rules.

Note     A validation rule needs an explanation, so people know why they can’t enter particular data in the form. You should put the explanatory text in the Validation Text property box.

Page 28 of 31PREVNEXT