Ignore code in QueryClose event

Dear all,I have this code on a fom queryclose event. my problem is i need to press a button to close and reopen the document…i do not need to run this code only at that instance. how can i do this …please guide me

thanks

shana

Sub Queryclose(Source As Notesuidocument, Continue As Variant)

Dim ws As New NotesUIWorkspace

Dim cdoc As NotesUIDocument

Dim se As New notessession



Set cdoc = ws.CurrentDocument 

Dim sNeAp  As String



sNeAp = cdoc.FieldGetText ("LAS_MainLone_NextApprover")

If cdoc.FieldGetText ("CloseUpdate") = "" Then

	If sNeAp  = se.CommonUserName Or sNeAp ="Not Defined Yet" Then	

		iMsg =Msgbox ("Are you sure that you want to save this application?" , 4+32 ,"Confirmation...!!!"	)	

		If iMsg =6 Then

			Call cdoc.Save()

		Else

			Exit Sub

		End If

	End If		

End If	

End Sub

Subject: ignore code in QueryClose event

I’m not sure what you’re asking. If you want the closing of the document to stop, then assign false to Continue like so:

continue = false

and the close process will not be continued

Subject: RE: ignore code in QueryClose event

i do not need to stop closing the document. i need to stop executing the code in queryclose event eg: when i click on a button i have a code to close and open the document i don’t want to execute the code in queryclose event at that time…pls guide meshana

Subject: RE: ignore code in QueryClose event

All you need is something to use in an If statement. That can be a field value or a LotusScript variable declared in the form’s Globals (so it’s available both in the button and in the QueryClose).

Subject: oh…thanks…