Create a Validation Formula and Message
In the Forms Designer, right-click the field or control for which you want to create a validation formula, then click Properties.
Click the Validation tab in the Properties dialog box.
Select the Validate this field before closing the form check box.
In the Validation Formula box, type the formula that you want to use to evaluate user input.
In the Display this message if the validation fails box, type the text that you want to appear in the message.
Click OK.
For more information, see the following:
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.