FieldValidate Event

The FieldValidate event occurs when a when user attempts to set a new value for a field on the form.

Syntax

Function FieldValidate(Form, Name, Value)

Arguments

Form
The form object that contains the field that is being validated.
Name
The name of the field that requires validation.
Value
The value of the field that requires validation.

Remarks

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.

Examples

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