Create a Validation Formula and Message

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

  1. In the Forms Designer, right-click the field or control for which you want to create a validation formula, then click Properties.

  2. Click the Validation tab in the Properties dialog box.

  3. Select the Validate this field before closing the form check box.

  4. In the Validation Formula box, type the formula that you want to use to evaluate user input.

  5. In the Display this message if the validation fails box, type the text that you want to appear in the message.

  6. Click OK.

For more information, see the following:

Show: