<?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: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/51090.aspx</link><pubDate>Thu, 28 Jan 2010 14:24:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51090</guid><dc:creator>reggieoverton</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51090.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51090</wfw:commentRss><description>&lt;p&gt;What if the fields are pointing to access. Meaning the infopath form is connected to access database. How do u point to them using VBscript?&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/32016.aspx</link><pubDate>Thu, 04 Sep 2008 21:19:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32016</guid><dc:creator>Brooke Hyde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32016.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32016</wfw:commentRss><description>&lt;p&gt;Hilary, Thanks so much for all your help!&lt;/p&gt;
&lt;p&gt;I got this working. &lt;/p&gt;
&lt;p&gt;I was having problems because there were groups inside my repeating group. &lt;/p&gt;
&lt;p&gt;I simiplified my XML schema and put all the fields inside the repeating group and it works like a charm. &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brooke&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/32004.aspx</link><pubDate>Thu, 04 Sep 2008 16:59:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32004</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32004</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t know the VBScript syntax off hand, but you&amp;#39;ll want selectNodes instead of selectSingleNode and then your xpath should point to the appropriate node group.&lt;/p&gt;
&lt;p&gt;In C# (IP2003) we use foreach (IXMLDomNode item in variableName) and then put the logic for the loop (in your case, the calculation code) in between some curly braces. I think VBScript uses for each item in variableName, followed by the logic, and finishing with next to move to the next node.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.devguru.com/Technologies/xmldom/QuickRef/node_selectNodes.html"&gt;Here&lt;/a&gt; is a link with more info on selectNodes that deals with VBScript.&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/32000.aspx</link><pubDate>Thu, 04 Sep 2008 16:02:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32000</guid><dc:creator>Brooke Hyde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32000.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32000</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m still having some issues.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I changed the code to use eventObj instead of the CTRL name.&amp;nbsp; The code will still execute on the first group but won&amp;#39;t execute on subsequent groups. &lt;/p&gt;
&lt;p&gt;The button the executes the script changes the view to a view with the results&amp;nbsp;fields and display the results for the record that data is being entered for. &lt;/p&gt;
&lt;p&gt;When I try to calculate for the second group the script kicks off and then runs calculations for the first group only. The calculations for every group must be calculated. &lt;/p&gt;
&lt;p&gt;I think that I may need to run the calculation for all the groups by&amp;nbsp;iterating&amp;nbsp;through the nodes. &lt;/p&gt;
&lt;p&gt;Could you point me in the right direction to do that? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/31929.aspx</link><pubDate>Wed, 03 Sep 2008 16:56:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31929</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31929.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31929</wfw:commentRss><description>&lt;p&gt;Whoops, you don&amp;#39;t use the CTRL name, you use eventObj. I&amp;#39;m sorry I confused you, I included the event handler sig so you&amp;#39;d see the (eventObj) argument being passed in. Try:&lt;/p&gt;
&lt;p&gt;set objectvariable = eventObj.Source.selectSingleNode(&amp;quot;XPath&amp;quot;)&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/31926.aspx</link><pubDate>Wed, 03 Sep 2008 16:15:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31926</guid><dc:creator>Brooke Hyde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31926.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31926</wfw:commentRss><description>&lt;p&gt;Hilary, &lt;/p&gt;
&lt;p&gt;Thanks for replying so quickly.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;My button is inside my sections. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;i have changed my code to read&lt;/p&gt;
&lt;p&gt;set objectvariable = CTRL69_8_OnClick.Source.selectSingleNode(&amp;quot;XPath&amp;quot;)&lt;/p&gt;
&lt;p&gt;Now I get the following error. Type mismatch: &amp;#39;CTRL69_8_OnClick&amp;#39;&lt;/p&gt;
&lt;p&gt;I tried commenting that line out to better&amp;nbsp;diagnose and it still gets the same error on that line.&amp;nbsp; The line that errors is the first line whe I am using the eventobj variable to get data from the form.&lt;/p&gt;
&lt;p&gt;Do I still need to use the set command when getting the data? &lt;/p&gt;
&lt;p&gt;Do you know if I still need to use an object or&amp;nbsp;will a double type variable work? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Brooke&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/31921.aspx</link><pubDate>Wed, 03 Sep 2008 15:10:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31921</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31921.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31921</wfw:commentRss><description>&lt;p&gt;Hi, Brooke:&lt;/p&gt;
&lt;p&gt;Is your button in the repeating group? Or do you have one button that is supposed to calculate all the repeating groups?&lt;/p&gt;
&lt;p&gt;If the button is inside the repeating group, you can use the eventObj variable to select the correct instance of the group. &lt;/p&gt;
&lt;p&gt;Your button&amp;#39;s event handler looks something like this (with the CTRL name depending upon the name of your control): Sub CTRL1_5_OnClick(eventObj)&lt;/p&gt;
&lt;p&gt;If you use eventObj.Source.selectSingleNode(&amp;quot;xpath&amp;quot;) you can get the fields in the group the button is located in. For example, say the xpath to my field is this: /my:myFields/my:topGroup/my:repeatingGroup/my:rgField1 and my button is sitting in my:repeatingGroup. To get my:rgField1, I could use eventObj.Source.selectSingleNode(&amp;quot;my:rgField1&amp;quot;).&lt;/p&gt;
&lt;p&gt;Now, if you have one button on the whole form, and you want to run calculations for all the groups, instead of using selectSingleNode, you&amp;#39;ll use selectNodes and iterate through all the nodes, performing your calculations on each group as you go through. Does that make sense? Let me know if you need more help....&lt;/p&gt;</description></item><item><title>How to do programming with Repeating Sections?</title><link>https://www.infopathdev.com:443/forums/thread/31916.aspx</link><pubDate>Wed, 03 Sep 2008 14:00:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31916</guid><dc:creator>Brooke Hyde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31916.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31916</wfw:commentRss><description>&lt;p&gt;I am working on a project that requires the user to enter data into a group of fields and then hit a calculate button and then calculations are ran using a vbscript.&amp;nbsp; The view is changed and the&amp;nbsp; results are shown in a new infopath view. &lt;/p&gt;
&lt;p&gt;I have this working for the first group of items in the repeating section. &lt;/p&gt;
&lt;p&gt;When I enter data for the second repeating section the script does not work. &lt;/p&gt;
&lt;p&gt;I have figured out that it doesn&amp;#39;t work because&amp;nbsp;the XPath is still pointing at the first group in the repeating section. &lt;/p&gt;
&lt;p&gt;In the VBscript,&amp;nbsp;I am using&amp;nbsp; the following code to access the fields&lt;/p&gt;
&lt;p&gt;object=XDocument.DOM.selectSingleNode(&amp;quot;XPATH&amp;quot;)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;How can I make it iterate to the next group in the repeating section? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>