The FieldValidate event occurs when a when user attempts to set a new value for a field on the form.
SyntaxFunction FieldValidate(Form, Name, Value)
- The form object that contains the field that is being validated.
- The name of the field that requires validation.
- The value of the field that requires validation.
You can use this event to perform tasks such as validating user input for a form field. If the return value is empty string then validation is assumed to have been successful.
Function FieldValidate(Form, Name, Value) FieldValidate = "" 'Write custom validation to check that the user is attempting to enter a value for "Amount" field that is greater then 100. If ( Name ="Amount") Then If (CInt( Value) > 100) Then 'Return Error Message FieldValidate = "Amount cannot be greater than 100." End If End If End Function