Validate data by using an event procedure

Validate data by using an event procedure

  1. Open the form in Design view.

  2. Create the event procedure for the event that you want to trigger the validation.

    How?

    For example, to trigger the validation rule when a control is updated with changed data, create an event procedure for the control's BeforeUpdate event.

  3. Add Visual Basic for Applications code to the event procedure, specifying the validation condition and the operations to perform when those conditions are met.

Tips

For an example of validating data by using an event procedure, click .

For information about the events used for data validation, click .

For information about the order of validation for controls and fields, click .