add 2 instances with one button and populate a table

In my form I have page where some of the text fields also populate fields in a summary table located on a previous page. When an "add" button is clicked, it creates a new instance of the page, increments a "Rec" number and adds a summary table following the first. This is all working as needed except for the text fields that are populating the summary. When a new instance is added, the new information is not populating with the new subform information rather it is again repeating the information from the first instance of the subform.

The table is referencing the fields using formcalc:
$=recNo

etc. for all the fields.

How can I get the new instance of the table populated with the new instance of the subform?

Thanks


Elaine Reaume


1 Answer

I have reworked my form but don't seem to have a way to delete my previous post, however, I still have a problem.
My form is for building inspections in a certain area. Basically the first building is inspected and the inspector has the ability to add recommendations by selecting a radio button. Selecting this changes the presence of the Recommendation form to visible and adds a summary of the recommendation in a table called Summary.
My code when selecting the radio button and showing the Summary and Recommendation is:

if(this.rawValue == 1)
Recommend.presence = "visible";
else
Recommend.presence = "hidden";

if(this.rawValue == 1)
actionSummary._Summary.setInstances(1);

In the recommendation, they have the ability to add additional recommendations which subsequently adds new summaries. This is all working fine however, my problem is once the inspector adds another building. When they add recommendations for the new building, my summary instances resets to 1 and deletes everything that was already there from the first building.

I tried adding this to the radio button but it did not work:

if(actionSummary.Summary.index => 1)
actionSummary._Summary.addInstance(1);

What I need it to do when a new building is added with recommendations is add the summaries to the end of what is already there.

Can anyone help?


Elaine Reaume   


Please specify a reason: