Reopen a new document

Hi All!

I made a form which contains a computed subform. I have to reopen the document to see the subform.

My problem is, that it is working for saved documents and I cannot use for new document.

If I use it for new documents than the document opens with the default form, not with original form.

Here is the code:

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Set docui=ws.CurrentDocument

Set doc=docui.Document

docui.document.saveoptions = "0"

Call docui.Close

Dim docui2 As NotesUIDocument

Set docui2 = ws.EditDocument( True , doc,False, , True, )

End Sub

Subject: Reopen a new document

Is the subform computed based on a formula? If so, what’s the formula? Subform formulas can’t be recomputed on the fly so there must be something wrong with the way it’s set up, eg if it’s based on a field value is the field above the subform?

Dan

Subject: RE: Reopen a new document

The subform is calculated based on field named “Subforms”. The field is a dialog list, you can select a subform. The formula is “@If(Subforms=”“;”“;Subforms)” .I tried to set up an other form as default and the process was the same. At the end I removed the “default form” and when I tried again to reopen the document I get the following error message: “Cannot open the default form”. At the end I added a field named “form” with the value of the form and that helped.

So now it is working but…

Attila

Subject: RE: Reopen a new document

Yeah, as I said, subforms can’t be recalculated on the fly like this.

What I tend to do is embed all the subforms on the form and then just hide them dependant on the value of the dialog field. Then when the dialog field is changed the hide-whens change and the new fields are presented.

Dan