Passing variable between forms

I have two forms. One form is containing 4 radio buttons and one Submit button. I choose one option, I hit the Submit button and depending on the choise, the other form is displayed. The first part of form is still the same, but the second part (subform), should be rendered depending on the choice.

I have created a hidden button on the 1’st form and I have set it like this:

@SetField(fieldname,value) …

On the second form, I was testnig this like:

@if(hidden_button=“one”;“run_subform_one”)

The IF statement is under Computed Subform - Default Value …

The problem is, that I can not see the variable from the first form …

How can I solve this?

Subject: Passing variable between forms

Save and reopen the uidocument after the choice, and you can see the subform on the document.

Subject: RE: Passing variable between forms

Hm, the problem is, that I need to show the subform onLoad of the form …

I do not want to display it after save …

Subject: RE: Passing variable between forms

If you want to dispaly it when opening the document for the first time, the value of the choice must be set in the document before the open.

Subject: RE: Passing variable between forms

Based on your posts so far, I can’t say for sure what exactly you’re trying to do. (Does “form” mean form, subform, or document at any one time you use the word?) However, it’s important to understand that computed subform formulas are only calculated at document open – which is why Hisaharu recommended closing and reopening the document. Don’t know if that helps…

Subject: RE: Passing variable between forms

Hm, I have to change the logic of the application … As you have said, it have to be clear, which subform I am going to display before the main form is displayed … Thanx for posts!

Subject: RE: Passing variable between forms

The following script can enable users to feel to change the subform without reopening the uidocument after opening.

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = ws.CurrentDocument

Dim doc As NotesDocument

Set doc = uidoc.Document

uidoc.Save

rem uidoc close

uidoc.Close

rem uidoc reopen

Call ws.EditDocument(True, doc)

End Sub

Subform is a RichText. This script is the same to one to refresh the notesdocument in the notes client after chaging a rich text fied.

Subject: RE: Passing variable between forms

Please note that you are closing and re-opening the document (uidoc.CLose + ws.EditDocument is a bit of a giveaway, isn’t it?). There’s no magic that can prevent the need to close and re-open the document.