Saving Form

Hi,

I have a form that has a list of fields that need to be completed before the user can submit the form.

I have used

QuerySave :-

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim session As New NotesSession	

Dim ws As New NotesUIWorkspace

Dim Workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim doc As NotesDocument



Call source.Refresh



Set doc = source.Document

If doc.BSSkillsRating(0) = "" Then

	Msgbox "Please enter Skills Rating" , 16, "Field Contains No Value"

	Continue = False

	End

End If



Set doc = source.Document

If doc.BSHelpDeskRating(0) = "" Then

	Msgbox "Please enter Help Desk Rating" , 16, "Field Contains No Value"

	Continue = False

	End

End If

End Sub

But if they try to submit the form before completing all the fields it gives them the option to save the document. How do I get the save option only to appear when all fields have been completed ?

Many Thanks

Stefan

Subject: Saving Form

QuerySave Fires only in case the save is triggered from the front end doc using the following methods

  1. CTRL + S

  2. File ->Save

  3. using formula command @Command([FileSave])

  4. using uidoc.Save method.

Make sure that the submit button is saving the document using any of the above mentioned method and not using the NotesDocument.Save method…

Becuase NotesDocument.Save does not invokes QuerySave event…

hoppe this helps…

Subject: Saving Form

You need to add Exit Sub after your Continue = False statements otherwise the code will continue to run regardless of whether your validation succeeds or fails.