Define validation rules to control when a record can be saved

Define validation rules to control when a record can be saved

  1. Open a table in Design view.

  2. Click Properties on the toolbar to display the table's property sheet.

  3. In the ValidationRule property box, type the validation rule. Or click the Build button to create the validation rule using the Expression Builder.

    For example, you could define the validation expression "[RequiredDate]<=[OrderDate]+30" to make sure that the date entered into the RequiredDate field is within 30 days of the date in the OrderDate field.

  4. In the ValidationText property box, type the message that you want Microsoft Access to display when the rule is broken.

    For example, for the validation expression "[RequiredDate]<=[OrderDate]+30," you could enter "The required date must be within 30 days of the order date."

    If you set a validation rule in a table that contains data, Microsoft Access will ask if you want to apply the new rule to existing data when you save the table.

Notes