<?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: Navigate through the fields in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/62246.aspx</link><pubDate>Mon, 13 Dec 2010 15:30:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:62246</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/62246.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=62246</wfw:commentRss><description>&lt;p&gt;Great to hear you figured it out!&lt;/p&gt;
&lt;p&gt;And, *THANKS* for posting your intelligence so that others can benefit. :)&lt;/p&gt;</description></item><item><title>Re: Navigate through the fields in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/62239.aspx</link><pubDate>Mon, 13 Dec 2010 13:50:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:62239</guid><dc:creator>josera</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/62239.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=62239</wfw:commentRss><description>&lt;p&gt;Thanks Patrick for your contribution.&lt;/p&gt;&lt;p&gt;&amp;nbsp;My form is based on SQL Server and Infopath forces me to use the data structure that it generates. This data structure is built on attributes so I don&amp;#39;t have a choice.&lt;/p&gt;&lt;p&gt;This is just a particular case. What I wanted to know is the way to navigate through the same line in a repeating table. I continued reading and experimenting and finally I made it work. This is the code that does it:&lt;/p&gt;&lt;p&gt;it is triggered after I select a date in the date picker of the column @Day in the repeating table, and after calculating the week of the year, it writes it on the column @WeekOfYear of the same line. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;SUB msoxd__ItemLines_Day_attr_OnAfterChange(eventObj)&lt;/b&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;b&gt;DIM fWeekOfYear&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;DIM day&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;day = eventObj.Site.text&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;SET fWeekOfYear = eventObj.Site.selectSingleNode(&amp;quot;../@WeekOfYear&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; This is the key to navigate to another column in the same line&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;fWeekOfYear.text = DatePart(&amp;quot;ww&amp;quot;, day, vbMonday, vbFirstFullWeek)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Calculation of the week of the year and writing it in other column&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;b&gt;END SUB&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Josera&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Navigate through the fields in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/62233.aspx</link><pubDate>Mon, 13 Dec 2010 12:56:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:62233</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/62233.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=62233</wfw:commentRss><description>&lt;p&gt;Hi Josera,&lt;/p&gt;
&lt;p&gt;First of all, it seems you are using attributes and not fields. Why is that? Why not use fields instead? Might make it easier to reference.&lt;/p&gt;
&lt;p&gt;To calculate Week of the Year, you should be able to do this with xpath: just subtract out the value for the beginning of the year and divide by seven. If the value is greater than 52, you can have another rule and function that subtracts 52. You will need to hardcode the value for the beginning of the year - just create a sample form with a datepicker and use it to identify the value. No code should be required.&lt;/p&gt;
&lt;p&gt;Maybe I am confused though ....&lt;/p&gt;</description></item><item><title>Navigate through the fields in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/61960.aspx</link><pubDate>Mon, 06 Dec 2010 14:30:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61960</guid><dc:creator>josera</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61960</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;

In one field of a repeating table, the user selects a date with a date picker. With the date I calculate the week of the year and I write it in other field of the same line of the repeating table. I am using VBScript. &lt;b&gt;@Day&lt;/b&gt; is the date picker and &lt;b&gt;@WeekOfTheYear&lt;/b&gt; is the destination field. I get to @Day attribute node with &lt;b&gt;eventObj.Site&lt;/b&gt; so I calculate the week of the year like this:&lt;/p&gt;&lt;p&gt;

DIM weekOfYear&lt;/p&gt;&lt;p&gt;
weekOfYear = DatePart(&amp;quot;ww&amp;quot;, eventObj.Site.text, 2, 3)&lt;/p&gt;&lt;p&gt;

Now I should write the calculated value in the destination but I cannot find the way to navigate from @Day to @WeekOfTheYear (both in the same line of the repeating table), using XPathNavigator.

In fact, It would be very simple to do if the calculations could be done with the Infopath available functions. In that case it could be done without code. I have done it for other calculations. But in this case I need to use VBScript and then the navigation from one attribute node to another sibling attribute node shows up.&lt;/p&gt;&lt;p&gt;

It looks to me that the solution should be very simple but nothing that I tried works. I would appreciate any help.&lt;/p&gt;&lt;p&gt;

Josera&lt;/p&gt;</description></item></channel></rss>