Examples: OnChange event

This is the OnChange event for the "Subject" field of a form. It writes the value of the Subject field to the SubjectDisplay field.

Sub Onchange(Source As Field)
  Dim ws As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Set uidoc = ws.CurrentDocument
  Call uidoc.FieldSetText("SubjectDisplay", _
  uidoc.FieldGetText("Subject"))
End Sub