Field_OnValidate Event

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

Field_OnValidate ( Form , FieldName , FieldValue )
Argument Description
Form The form object.
FieldName The name of the field that requires validation.
FieldValue 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 Field_OnValidate(Form, FieldName, FieldValue)
  ’Write custom validation to check that the user is attempting to enter a value for the Amount field that is less then 100.
  If (FieldName = ”Amount”) Then
    If (CInt(FieldValue) > 100) Then
      Field_OnValidate = ”Amount cannot be greater than 100.”
    End If
  End If
End Function