Problem linear execution

I have a problem with execution of my button.Normally my form must become another form i.e. my form take apparence of the another form, my form close it and the new form open it.

But in the execution my form become another form, the new form open it and the old form close it. So i have a problem with “SaveOptions”, the first “SaveOptions” is not use.

How resolve this problem.

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim S As New NotesSession

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument



Set db = S.Currentdatabase

Set uidoc = ws.Currentdocument

Set doc = uidoc.Document



doc.Form = "formulaire demande"

doc.DateDebut = ""

Call doc.Save(True, False)			doc.SaveOptions = "0"		

currentkey = doc.NoteID

Call uidoc.Close

	

Set doc = db.GetdocumentByID(currentkey)

Set uidoc = ws.EditDocument(True, doc)

doc.SaveOptions = "1"

End Sub

Subject: problem linear execution

It’s OkI have found another possibility.

I use saveOptions =“1” in another button.