Continue = False, but document still saved

When I select No to any of my prompts, it still saves the document?

Any ideas? Thank you.

** my code **

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim ws As New notesuiworkspace

Dim s As New NotesSession

Dim gstotal As Double

Dim gstamt As Double

Dim response As Integer

Set db = s.currentdatabase

Set doc = source.Document

If source.IsNewDoc Then

gstotal = doc.GTotal(0) * 1.25

gstamt1 = doc.invoiceAmt(0) - gstotal

gstamt2 = doc.invoiceAmt(0) - doc.GTotal(0)

If doc.gstInv(0) = “Yes” Then

If gstamt1 <> 0 Then

response = ws.Prompt (PROMPT_YESNO, _

“GST Invoice”, “The invoice amount does not equal 12.5%, do you wish to continue?”)

If response = 1 Then

Continue = True

Else

Continue = False

End If

End If

Else

response = ws.Prompt (PROMPT_YESNO, _

“GST Invoice”, “The invoice amount does not have GST are you sure you wish to continue?”)

If response = 1 Then

If gstamt <> 0 Then

Msgbox “The line items total does not match the Invoice amount please check your values”

Exit Sub

End If

Else

Continue = False

End If

End If

End If

End Sub

Subject: Continue = False, but document still saved

Subject: RE: Continue = False, but document still saved

Hi Willy,

Yes I have debugged, and it steps into the Continue=False, but it still saves the doc.

Subject: RE: Continue = False, but document still saved

Subject: RE: Continue = False, but document still saved

i guess Willy Lorenzo is right. Please check. other wise just add the line after your continue statement. i.e…



-----your code----

Continue=False

Exit Sub



----your code----

Subject: RE: Continue = False, but document still saved

Thanks Ray,

I had put the Exit sub in, and it works. Thanks again.

It did execute other code which saved it afterwards, should’ve check.

Thx

Subject: RE: Continue = False, but document still saved

Try assigning continue = False unconditionally very early in your code.If “continue” is unassigned it assumes a value of -1 which is the same as True and thus save the document.

You are are only giving Continue a value if a number of conditions are met.