Create a validation rule for a control

  1. Open a form in Design view.
  2. Select a control, and then click Properties on the toolbar to open the control's property sheet.
  3. In the ValidationRule property box, do one of the following:

    Type the validation rule.

    In a Microsoft Access database (.mdb), click the Build button to use the Expression Builder to create the validation rule.

  4. In the ValidationText property box, type the error message that you want displayed if the text entered violates the validation rule.

Note   In an Access database, if you set the ValidationRule property for the field in table Design view and also set the ValidationRule property for a control bound to that field, Access enforces both rules — the control validation rule doesn't override the field validation rule.