Examples: OnFocus event
This is the OnFocus event for the "Subject" field of a form. It supplies a default value.
Sub Onfocus(Source As Field)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
If uidoc.FieldGetText("Subject") = "" Then
Call uidoc.FieldSetText("Subject", "New subject")
End If
End Sub