<?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: Need help with JS code and an access database as main source</title><link>https://www.infopathdev.com:443/forums/thread/38533.aspx</link><pubDate>Tue, 17 Feb 2009 23:24:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38533</guid><dc:creator>nucel</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38533.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38533</wfw:commentRss><description>I figured it out, thank you all again to those who help us out here.</description></item><item><title>Need help with JS code and an access database as main source</title><link>https://www.infopathdev.com:443/forums/thread/38531.aspx</link><pubDate>Tue, 17 Feb 2009 22:35:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38531</guid><dc:creator>nucel</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38531.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38531</wfw:commentRss><description>&lt;p&gt;I am trying to write a calculation that adds three years from a date of birth entry and then puts the result date in a different field.&amp;nbsp; While I have done this with Infopath itself, I cannot seem to figure out how to select the proper node in my access datasource to put the result.&amp;nbsp; Please see data structure and code below:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img class="reflect" title="" height="390" alt="1 by you." src="http://farm4.static.flickr.com/3570/3288171965_6aa4341b1c.jpg?v=0" width="221" /&gt;&lt;/p&gt;
&lt;p&gt;function msoxd__tblChild_ChildDOB_attr::OnAfterChange(eventObj)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// Write code here to restore the global state. if (eventObj.IsUndoRedo)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// An undo or redo operation has occurred and the DOM is read-only. return; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// A field change has occurred and the DOM is writable. Write code here to respond to the changes. &lt;/p&gt;
&lt;p&gt;var tay=new Date()&lt;/p&gt;
&lt;p&gt;var tdy=GetDateString(tay)&lt;/p&gt;
&lt;p&gt;var dateObj = new Date(eventObj.Site.text.replace(/(\d\d\d\d)-(\d\d)-(\d\d)/, &amp;quot;$2-$3-$1&amp;quot;));&lt;/p&gt;
&lt;p&gt;// var dt = dateObj.getDate(); var dt=GetDateString(dateObj)&lt;/p&gt;
&lt;p&gt;//var dt= XDocument.DOM.selectSingleNode(&amp;quot;my:IFSP/my:DOB&amp;quot;).text var res =datediff1(dt,tdy,&amp;#39;m&amp;#39;)&lt;/p&gt;
&lt;p&gt;//XDocument.UI.Alert(&amp;#39;today &amp;#39;+res);&lt;/p&gt;
&lt;p&gt;var dateObj = new &lt;/p&gt;
&lt;p&gt;Date(eventObj.Site.text.replace(/(\d\d\d\d)-(\d\d)-(\d\d)/, &amp;quot;$2-$3-$1&amp;quot;))&lt;/p&gt;
&lt;p&gt;var dateYear = dateObj.getYear() &lt;/p&gt;
&lt;p&gt;dateObj.setYear(dateYear + 3) &lt;/p&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;&lt;strong&gt;my:myFields/my:dataFields/my:tblChild/my:ChildThirdBirthday&lt;/strong&gt;&amp;quot;).text = GetDateString(dateObj)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;The part in &lt;strong&gt;BOLD&lt;/strong&gt; is what I cannot figure out.&amp;nbsp; Thanks!&lt;/p&gt;</description></item></channel></rss>