I have the following code in the QuerySave event. I get the messagebox to pop up, then click OK and the document closees completely instead of moving to the next IF statement. Where do I put the Call uidoc.close or do I not need it?
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim Session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Call uidoc.refresh
'check for required fields
If (uidoc.FieldGetText("RequestedBy")="") Then
Msgbox("Requested By is required.")
uidoc.GoToField("RequestedBy")
Exit Sub
End If
If (uidoc.FieldGetText("Unit")="") Then
Msgbox("The Unit is required.")
uidoc.GoToField("Unit")
Exit Sub
End If
If (uidoc.FieldGetText("FObj")="") Then
Msgbox("The featured objective is required.")
uidoc.GoToField("FObj")
Exit Sub
End If
If (uidoc.FieldGetText("CollegeUnit")="Select College") Then
Msgbox("The unit, campus, college the fund supports is required.")
uidoc.GoToField("CollegeUnit")
Exit Sub
End If
If (uidoc.FieldGetText("Title")="") Then
Msgbox("The name of the allocation fund is required.")
uidoc.GoToField("Title")
Exit Sub
End If
If (uidoc.FieldGetText("Guideline")="") Then
Msgbox("Will fund have a Guideline is required.")
uidoc.GoToField("Guideline")
Exit Sub
End If
Call uidoc.save
Call uidoc.close
End Sub