Exit without saving from msgbox

Hello Notes Gurus,I have a little lotusscript that returns the value of a lookup and displays a message if the value is blank.

If the value is blank I need to exit and close the document without saving.

I have been trying a couple different ways with SaveOption field and Continue = false but nothing seems to work.

Any help is always appreciated

If lookupDoc.Manager(0) = “” Then

     Msgbox  "Error locating " +  Cstr(doc.ReportTo(0)) + "’s manager name in the person document of    the Domino Directory." + Chr$(13) + Chr$(13) +  "Approval hierarchy will be incomplete."  + Chr$(13) + Chr$(13) + "Please contact MIS at 773-292-7599." ,0 + 48, "Manager Lookup Error" 



Call uidoc.Save 

doc.SaveOptions="0"

Call uidoc.Close 

Continue = False

       Exit Sub

End If

Subject: Exit without saving from msgbox

You are setting the value in teh backend document, not in the open uidocument.

doc.SaveOptions=“0”

should be

Call uidoc.FieldSetText(“SaveOptions”,“0”)

You should not use extended notation anyway for backend documents, use the ReplaceItemValue method of the NotesDocument class to set values…

Subject: Exit without saving from msgbox

If you don’t want to save the document then don’t call uidoc.Save

Subject: RE: Exit without saving from msgbox

I am sorry but I did not fully explain the problem.

  1. I don’t want to save the document . The uidoc.Save in my example was a typo.

  2. The document is opened in edit mode.

  3. If lookupDoc.Manager(0) is blank , then i want to display a message and after the user click OK in the message box, close the document without saving.

I was looking for the easiest way to do this. I exhausted all my ideas.

Thanks for your response and brain power.

Subject: RE: Exit without saving from msgbox

I solved the problem . Call off the dogs . Thanks again.

Subject: Post what you did, so that next time someone like you can see the mistake