<?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: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33791.aspx</link><pubDate>Mon, 03 Nov 2008 10:49:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33791</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33791.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33791</wfw:commentRss><description>&lt;p&gt;I had already&amp;nbsp;written the code to carry out this part of the operation, but this is a much tidier solution.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33790.aspx</link><pubDate>Mon, 03 Nov 2008 10:25:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33790</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33790.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33790</wfw:commentRss><description>&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Hi,&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Please follow the below code lines in your OnAfterChange Event. Hope it helps you.&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Dim rowAdded &amp;#39; as Boolean&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;rowAdded = false&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Sub msoxd_my_group2_OnAfterChange(eventObj)&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;If eventObj.IsUndoRedo or rowAdded or eventObj.Operation &amp;lt;&amp;gt; &amp;quot;Insert&amp;quot; Then&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Exit Sub&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;End If&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;if eventObj.Source.parentNode.nodeName = &amp;quot;my:field2&amp;quot; then &amp;#39;specify the field name in which you check the length &lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;if Len(eventObj.Source.parentNode.text) &amp;gt; 255 Then&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;rowAdded = true&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;‘Add the table row over here&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;rowAdded = false&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;end if&lt;/span&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;end if&lt;/span&gt; 
&lt;p&gt;&lt;span style="FONT-SIZE:12pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;End Sub&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33786.aspx</link><pubDate>Mon, 03 Nov 2008 09:12:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33786</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33786.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33786</wfw:commentRss><description>&lt;p&gt;Jimmy&lt;/p&gt;
&lt;p&gt;The new row will be added when the user reaches the 255 character limit on the text box. This is to get around the limitations on the AccessDB it is submitted to.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33785.aspx</link><pubDate>Mon, 03 Nov 2008 09:09:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33785</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33785.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33785</wfw:commentRss><description>&lt;p&gt;Thanks Chandrakanth&lt;/p&gt;
&lt;p&gt;Just what I needed&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33766.aspx</link><pubDate>Sun, 02 Nov 2008 15:20:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33766</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33766.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33766</wfw:commentRss><description>&lt;p&gt;Under what conditions/after what action do you want to add a new row to the table?&amp;nbsp; Surely you don&amp;#39;t want to add a new row every time someone makes any change within the table.&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33705.aspx</link><pubDate>Fri, 31 Oct 2008 06:12:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33705</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33705.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33705</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hi,&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Please follow the below code lines in your OnAfterChange Event. Hope it helps you.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Dim rowAdded &amp;#39; as Boolean&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;rowAdded = false&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Sub msoxd_my_group2_OnAfterChange(eventObj)&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;If eventObj.IsUndoRedo or rowAdded Then&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Exit Sub&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;End If&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;rowAdded = true&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;‘Add the table row over here&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;rowAdded = false&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;End Sub&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33687.aspx</link><pubDate>Thu, 30 Oct 2008 14:51:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33687</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33687.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33687</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The reason for using OnAfterChange event is so that I can automate the insertion of a new row after the user input, rather than have a button.&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33682.aspx</link><pubDate>Thu, 30 Oct 2008 13:50:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33682</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33682.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33682</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;Iam not understanding why you are using onAfterChange event still?. without using this event you can able to implement your functionality with the code given by jimmy. Can you please explain me clearly why you are using the onAfterChange event.&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33679.aspx</link><pubDate>Thu, 30 Oct 2008 09:52:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33679</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33679.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33679</wfw:commentRss><description>&lt;p&gt;Thanks Jimmy&lt;/p&gt;
&lt;p&gt;That works fine with a button (OnClick event)&amp;nbsp;and I get a new blank row. When I try it with an onAfterChange event I get the following error:&lt;/p&gt;
&lt;p&gt;&amp;quot;The number of calls to the OnAfterChange event for a single update in the data exceeded the maximum limit.&amp;quot;&lt;/p&gt;
&lt;p&gt;and it inserts 15 blank rows. My coding skills are limited. Any thoughts on how I can limit this to one row?&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33651.aspx</link><pubDate>Wed, 29 Oct 2008 16:27:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33651</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33651.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33651</wfw:commentRss><description>&lt;p&gt;Have you tried using the ExecuteAction method?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;Sub CTRL5_5_OnClick(eventObj)&lt;br /&gt;&amp;nbsp;XDocument.View.ExecuteAction &amp;quot;xCollection::insert&amp;quot;, &amp;quot;group2_1&amp;quot;&amp;nbsp;&lt;br /&gt;&amp;nbsp;End Sub&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The second argument (&amp;quot;group2_1&amp;quot; in this case)&amp;nbsp;refers to&amp;nbsp;the XmlToEdit identifier for the repeating control and can be found on the Advanced tab of the repeating control&amp;#39;s properties.&lt;/p&gt;</description></item><item><title>Add new row with VBScript</title><link>https://www.infopathdev.com:443/forums/thread/33644.aspx</link><pubDate>Wed, 29 Oct 2008 14:37:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33644</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33644.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33644</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been scouring the forum and elswhere for a solution to this for the past few days. All I need to do is add a blank row to a repeating table. The following code has been cribbed from other sources on the forum but I am having trouble getting it to work.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Sub msoxd_my_field1_OnAfterChange(eventObj)&lt;/p&gt;
&lt;p&gt;&amp;#39;Add new row to repeating table programmatically&lt;/p&gt;
&lt;p&gt;Dim newxmlstring, oXML, oParent&lt;/p&gt;
&lt;p&gt;&amp;#39;Build XML needed for empty node&lt;/p&gt;
&lt;p&gt;newxmlstring = &amp;quot;&amp;lt;my:group4&amp;gt;&amp;lt;my:field1&amp;gt;&amp;lt;/my:field1&amp;gt;&amp;lt;/my:group4&amp;gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;#39;Create a new empty node&lt;/p&gt;
&lt;p&gt;Set oXML = XDocument.CreateDOM()&lt;/p&gt;
&lt;p&gt;oXML.loadXML(newxmlstring)&lt;/p&gt;
&lt;p&gt;&amp;#39;Define Parent&lt;/p&gt;
&lt;p&gt;Set oParent = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group3/my:group4&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;#39;set node &amp;#39;Set oNode = oXML.documentElement&lt;/p&gt;
&lt;p&gt;&amp;#39;Add new node to parent as XML&lt;/p&gt;
&lt;p&gt;oParent.appendChild(oXML.documentElement) --------- &lt;strong&gt;code fails here Error: Invalid procedure call or argument&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Can anyone help or point me towards a solution?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item></channel></rss>