@If(@ThisValue = ""; "You must enter a date"; @Year(@ThisValue) < 1950; "Please enter a date no earlier than 1950 A.D."; @Success)Or, in a Querysave form event, you might do something like this:
Sub Querysave(Source As NotesUIDocument, Continue As Variant) Dim doc As NotesDocument Set doc = Source.Document If doc.DateField(0) = "" Then msgbox "You must enter a date." Source.GotoField "DateField" Continue = False Elseif Year(doc.DateField(0)) < 1950 msgbox "You must enter a date no earlier than 1950." Source.GotoField "DateField" Continue = False End If End Sub
Perhaps you can see why I prefer macro language.
Do you have comments on this Ask the Expert Q&A? Let us know.
This was first published in March 2004