Use the repeating table you have and 4 regular fields, CustId, NoOranges, NoApples, NoPears
When the user has filled in the form and saves, closes or what ever, use this script to create 3 rows in the repeating table.
// get values
IXMLDOMNode CustID = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:MyFields/@CustID");
IXMLDOMNode NoOranges = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:MyFields/@Oranges");
IXMLDOMNode NoApples = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:MyFields/@Apples");
IXMLDOMNode NoPears = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:MyFields/@Pears");
// get a reference to the node the repeating table is bound to
IXMLDOMNode row = thisXDocument.DOM.selectSingleNode("//d:repeatingtable1");
// make a copy of the node by cloning it
row = row.cloneNode(true);
// set the new values of the row#%92s fields for Oranges
row.selectSingleNode("@RepeatingTableID").text = "";
row.selectSingleNode("@CustID").text = CustID.text;
row.selectSingleNode("@Type").text = "1";
row.selectSingleNode("@Number").text = NoOranges.text;
// append the cloned row to the parent node
IXMLDOMNode parent = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields");
parent.appendChild(row);
// set the new values of the row#%92s fields for Apples
row.selectSingleNode("@RepeatingTableID").text = "";
row.selectSingleNode("@CustID").text = CustID.text;
row.selectSingleNode("@Type").text = "2";
row.selectSingleNode("@Number").text = NoApples.text;
// append the cloned row to the parent node
IXMLDOMNode parent = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields");
parent.appendChild(row);
// set the new values of the row#%92s fields for Pears
row.selectSingleNode("@RepeatingTableID").text = "";
row.selectSingleNode("@CustID").text = CustID.text;
row.selectSingleNode("@Type").text = "3";
row.selectSingleNode("@Number").text = NoPears.text;
// append the cloned row to the parent node
IXMLDOMNode parent = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields");
parent.appendChild(row);
Ok, this worked for me after lots of tidying up on one of my forms. Also you'll have to put in the first row straight into the database as this can only clone and paster rows not create them.
I posted this in a rush, ask if i did something silly