<?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>InfoPath 2010</title><link>https://www.infopathdev.com:443/forums/142.aspx</link><description>Are you exploring new features coming up in 2010? Share information and ask questions here!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76884.aspx</link><pubDate>Mon, 26 Mar 2012 23:48:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76884</guid><dc:creator>Anson Hidajat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76884.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76884</wfw:commentRss><description>I don&amp;#39;t believe that admin approving the template will allow code to run on the client, so that won&amp;#39;t fix the number of postbacks you are encountering.&amp;nbsp; Not sure if anyone has suggested this yet, but you can look into optimizing your form by limiting which controls will postback in the control properties browser forms tab.&amp;nbsp; If the formulas, queries, etc. need to only be run on certain actions, this is a great way to improve the performance on your form.</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76882.aspx</link><pubDate>Mon, 26 Mar 2012 23:41:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76882</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76882.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76882</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s an interesting question. I&amp;#39;m not sure of the answer on that - I&amp;#39;m going to ask Anson to chime in.&lt;/p&gt;</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76845.aspx</link><pubDate>Mon, 26 Mar 2012 13:48:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76845</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76845.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76845</wfw:commentRss><description>One more question... right now I have it running in a sandboxed environment. This is great but all the postbacks take a second to send data to the server. Would publishing the form via &amp;#39;admin-approved&amp;#39; method allow the code to run in full trust without having to send it to a controlled environment?</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76806.aspx</link><pubDate>Fri, 23 Mar 2012 15:59:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76806</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76806.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76806</wfw:commentRss><description>&lt;p&gt;Hey, that&amp;#39;s great news! Good job!&lt;/p&gt;</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76805.aspx</link><pubDate>Fri, 23 Mar 2012 15:51:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76805</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76805.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76805</wfw:commentRss><description>Thanks so much for your help! I got it working :)</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76587.aspx</link><pubDate>Mon, 19 Mar 2012 17:04:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76587</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76587.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76587</wfw:commentRss><description>&lt;p&gt;No, don&amp;#39;t change the event handler. You need to change the code itself.&lt;/p&gt;</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76585.aspx</link><pubDate>Mon, 19 Mar 2012 16:49:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76585</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76585.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76585</wfw:commentRss><description>So I should leave the handler as is when I create the changed event (AddHandler EventManager.XmlEvents(&amp;quot;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:EndDate&amp;quot;).Changed, AddressOf EndDate_Changed) or make the Xpath dynamic?</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76584.aspx</link><pubDate>Mon, 19 Mar 2012 16:02:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76584</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76584.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76584</wfw:commentRss><description>&lt;p&gt;This code is on the change of a field w/in the repeating table? &lt;/p&gt;
&lt;p&gt;This is an absolute XPath:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:StartDate&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It starts at the root node.&lt;/p&gt;
&lt;p&gt;The method signature for the field that you added the changed event to will look something like this:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;Public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; field2_Changed(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XmlEventArgs)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;/font&gt;You can use &lt;em&gt;e.Site &lt;/em&gt;to get the field you are currently on. More on &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xmleventargs(v=office.11).aspx"&gt;MSDN&lt;/a&gt; here and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xmleventargs.site(v=office.11).aspx"&gt;here&lt;/a&gt;. You can use a relative XPath then to get to your other fields, like perhaps:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;e.Site.SelectSingleNode(&amp;quot;../my:EndDate&amp;quot;, NamespaceManager)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76582.aspx</link><pubDate>Mon, 19 Mar 2012 15:40:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76582</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76582.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76582</wfw:commentRss><description>That makes sense. What would a relative Xpath look like? Here&amp;#39;s most of the code. Thanks for helping me out :)

also: is there a way to insert line breaks or format for code in this forum? that looks terrible. 



Dim startDate, endDate As XPathNavigator 
Dim dayDifference As Integer
Dim hours As String
startDate = (MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:StartDate&amp;quot;, NamespaceManager))
endDate = (MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:EndDate&amp;quot;, NamespaceManager))
Dim startDateinnerxml, endDateinnerxml As Date
startDateinnerxml = startDate.InnerXml
endDateinnerxml = endDate.InnerXml

If Not startDate Is DBNull.Value Then
dayDifference = WorkDays(startDateinnerxml, endDateinnerxml) + 1
MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:dayDifference&amp;quot;, NamespaceManager).SetValue(dayDifference)
hours = dayDifference * 7.5
 MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/my:Info/my:UserInput/my:HoursEntry/my:Hours&amp;quot;, NamespaceManager).SetValue(hours)
   End If</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76579.aspx</link><pubDate>Mon, 19 Mar 2012 15:27:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76579</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76579.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76579</wfw:commentRss><description>&lt;p&gt;In general, the reason this happens is because the code uses an absolute XPath instead of a relative XPath. Without seeing your actual code, of course, I have no way of knowing why your code is not working as anticipated.&lt;/p&gt;</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76572.aspx</link><pubDate>Mon, 19 Mar 2012 13:19:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76572</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76572.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76572</wfw:commentRss><description>Hello, I&amp;#39;m writing this in VB. It runs when the second date changes, pulls InnerXML from each of the dates, runs it through a function I found on here that calculates the number of work days in a given range then multiplies it by 7.5 (because we&amp;#39;re working with hours). If you&amp;#39;d like to see the actual code I can attach that.</description></item><item><title>Re: Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76559.aspx</link><pubDate>Fri, 16 Mar 2012 23:23:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76559</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76559.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76559</wfw:commentRss><description>&lt;p&gt;You are doing this in code? What&amp;#39;s your code look like? &lt;/p&gt;</description></item><item><title>Code for multiple rows in a repeating table (VB)</title><link>https://www.infopathdev.com:443/forums/thread/76434.aspx</link><pubDate>Wed, 14 Mar 2012 15:57:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76434</guid><dc:creator>samauger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76434.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=76434</wfw:commentRss><description>Hello, 

I have a repeating table that users will use to enter their leave hours. I have fields for startDate, endDate, reason, and hours. I&amp;#39;ve gotten to the point where it checks the difference between the dates, multiplies the number of days take off by 7.5 (hours in a full work day) and sets the hours field to that number. The only problem is that it only works on the first row. I&amp;#39;m sure the solution is simple but so far I haven&amp;#39;t found anything very helpful. 

Thanks!</description></item></channel></rss>