<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Inserting into Repeating Table (Main Connection)</title><link>https://www.infopathdev.com:443/forums/thread/14484.aspx</link><pubDate>Thu, 13 Apr 2006 16:44:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14484</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14484.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14484</wfw:commentRss><description>You code is unable to clone the row because it can't find one.  Even though your template.xml has an ETF row in, it might not have it there when the code runs due to querying the database and returning no results. This seems like the problem.&lt;br /&gt;&lt;br /&gt;I can't see any problems with the code, but if the selectSingleNode() is returning null then there is no row there.  You need to figure out why that is and then you can clone it.&lt;br /&gt;&lt;br /&gt;Otherwise, you could try creating a node from scratch by using the createNode() function of the DOM and then populating it with your appropriate values.&lt;br /&gt;&lt;br /&gt;Check out these methods in the MSXML 5.0 SDK:&lt;br /&gt;createDocumentFragment()&lt;br /&gt;createElement()&lt;br /&gt;createNode()&lt;br /&gt;appendChild()&lt;br /&gt;replaceChild()&lt;br /&gt;</description></item><item><title>Re: Inserting into Repeating Table (Main Connection)</title><link>https://www.infopathdev.com:443/forums/thread/14483.aspx</link><pubDate>Thu, 13 Apr 2006 15:26:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14483</guid><dc:creator>Queezy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14483.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14483</wfw:commentRss><description>I added row to the QuickWatch in MSE.&lt;br /&gt;It shows row with a value of "null" and its type as "Object".&lt;br /&gt;</description></item><item><title>Re: Inserting into Repeating Table (Main Connection)</title><link>https://www.infopathdev.com:443/forums/thread/14482.aspx</link><pubDate>Thu, 13 Apr 2006 14:00:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14482</guid><dc:creator>Shyam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14482.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14482</wfw:commentRss><description>Hello Queezy,&lt;br /&gt;&lt;br /&gt;You seem to be saying "row.cloneNode()" method is giving you error. Did you stop at this line in debugger and see what the type of "row" object is and its contents ? Looks like you are expecting it to be an IXMLDOMNode type. If it is, then can you check what is the xml in this node ?&lt;br /&gt; &lt;br /&gt;thanks, Shyam</description></item><item><title>Inserting into Repeating Table (Main Connection)</title><link>https://www.infopathdev.com:443/forums/thread/12842.aspx</link><pubDate>Wed, 12 Apr 2006 20:54:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12842</guid><dc:creator>Queezy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12842.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12842</wfw:commentRss><description>Ok, so after weeks  of working on this, and reading every possible post (multiple times) on inserting into repeating tables(here &amp; Google Groups), I'm giving in and posting my problem.&lt;br /&gt;I am trying to insert into an Access database basically a "receipt" of everything that was chosen on the form.  The form already updates other tables just fine, but I need it to insert a row in my ETF table each time the form is filled out &amp; submitted.  I couldnt seem to insert a new row in the ETF table, as Infopath always tried to update a current record in the ETF table that matched a foreign key, since I queried for the updates in other tables.  I noticed when I placed my datafields on my form as a repeating table, I could insert manually values into the ETF table, and when I hit submit, my form would update the other tables like it always did, but it inserted a new row in the ETF.  This is when I realized I needed to programmatically insert into my ETF datafields, and if need be hide the repeating table, but I'm thinking I won't need the repeating table at all and will eventually just insert into the table, after this code is right.&lt;br /&gt;Any help would greatly be appreciated! Any questions let me know!&lt;br /&gt;&lt;br /&gt;My code gets stopped at row = row.cloneNode(true);&lt;br /&gt;with the error - 'null' is null or not an object&lt;br /&gt;&lt;br /&gt;Here is what I have so far-&lt;br /&gt;&lt;br /&gt;&lt;b&gt;TEMPLATE.xml -&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;?mso-infoPathSolution name="urn:schemas-microsoft-&lt;br /&gt;com:office:infopath:New-Folder--2-:-dataFormSolution" &lt;br /&gt;href="manifest.xsf" solutionVersion="1.0.0.20" initialView="View 1" &lt;br /&gt;productVersion="11.0.6565" PIVersion="1.0.0.0" ?&amp;gt;&lt;br /&gt;&amp;lt;?mso-application progid="InfoPath.Document"?&amp;gt;&lt;br /&gt;&amp;lt;dfs:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields" &lt;br /&gt;xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" &lt;br /&gt;xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" &lt;br /&gt;xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-22T15:18:03" &lt;br /&gt;xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"&amp;gt;&lt;br /&gt;	&amp;lt;dfs:queryFields&amp;gt;&lt;br /&gt;		&amp;lt;q:DSCP CID="" TeamID=""&amp;gt;&amp;lt;/q:DSCP&amp;gt;&lt;br /&gt;		&amp;lt;q:Labor CID="" PLC=""&amp;gt;&amp;lt;/q:Labor&amp;gt;&lt;br /&gt;		&amp;lt;q:Salary CID="" Rate="" FLSA=""&amp;gt;&amp;lt;/q:Salary&amp;gt;&lt;br /&gt;		&amp;lt;q:ETF ETFID="" CID="" StatusID="" ChangeID="" &lt;br /&gt;OldTaskID="" OldPLC="" OldFLSA="" OldRate="" NewTaskID="" NewPLC="" &lt;br /&gt;NewFLSA="" NewRate="" PayChangeDate="" OtherChangeDate=""&amp;gt;&amp;lt;/q:ETF&amp;gt;&lt;br /&gt;	&amp;lt;/dfs:queryFields&amp;gt;&lt;br /&gt;	&amp;lt;dfs:dataFields&amp;gt;&lt;br /&gt;		&amp;lt;d:DSCP CID="" TeamID=""&amp;gt;&lt;br /&gt;			&amp;lt;d:Labor CID="" PLC=""&amp;gt;&amp;lt;/d:Labor&amp;gt;&lt;br /&gt;			&amp;lt;d:Salary CID="" Rate="" FLSA=""&amp;gt;&amp;lt;/d:Salary&amp;gt;&lt;br /&gt;			&amp;lt;d:ETF ETFID="" CID="" StatusID="" &lt;br /&gt;ChangeID="" OldTaskID="" OldPLC="" OldFLSA="" OldRate="" NewTaskID="" NewPLC="" NewFLSA="" NewRate="" PayChangeDate="" &lt;br /&gt;OtherChangeDate=""&amp;gt;&amp;lt;/d:ETF&amp;gt;&lt;br /&gt;		&amp;lt;/d:DSCP&amp;gt;&lt;br /&gt;	&amp;lt;/dfs:dataFields&amp;gt;&lt;br /&gt;	&amp;lt;my:Local my:ProposedTeamID=""&amp;gt;&lt;br /&gt;        ........(many fields)&lt;br /&gt;        &amp;lt;/my:Local&amp;gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;&lt;b&gt;CODE-&amp;gt;&lt;/b&gt;&lt;br /&gt;//&amp;lt;namespacesDefinition&amp;gt;&lt;br /&gt;XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &lt;br /&gt;xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields" &lt;br /&gt;xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" &lt;br /&gt;xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" &lt;br /&gt;xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-22T15:18:03" &lt;br /&gt;xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');&lt;br /&gt;//&amp;lt;/namespacesDefinition&amp;gt;&lt;br /&gt;&lt;br /&gt;function CTRL174_7::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;        var doc = XDocument.DataObjects("DSCP");&lt;br /&gt;	doc.DOM.setProperty("SelectionNamespaces", &lt;br /&gt;'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" ' &lt;br /&gt;+ 'xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" ' + '&lt;br /&gt;xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"'); &lt;br /&gt;	var row = doc.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:DSCP/d:ETF");&lt;br /&gt;	row = row.cloneNode(true);&lt;br /&gt;	row.selectSingleNode("/dfs:myFields/dfs:dataFields/d:DSCP/d:ETF/@CID").text = "TEST"; &lt;br /&gt;	//Rest of fields in repeating table would be inputted here, just like CID was above.&lt;br /&gt;	var parent = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:/dataFields/d:DSCP");&lt;br /&gt;	parent.appendChild(row);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description></item></channel></rss>