<?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: Big problem calculating</title><link>https://www.infopathdev.com:443/forums/thread/91679.aspx</link><pubDate>Sun, 28 Jul 2013 04:43:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91679</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91679.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=91679</wfw:commentRss><description>&lt;p&gt;Hi Dr Goebel and welcome,&lt;/p&gt;
&lt;p&gt;It sure is frustrating that an update would cause a break. I&amp;#39;m not sure why this broke but I have a simple solution.&lt;/p&gt;
&lt;p&gt;Replace the code with declarative logic in the form. You can do your calculation just fine without code. &lt;/p&gt;
&lt;p&gt;Just add a rule and an action to set the value with the calculation. All Xpath and it will work fine. You will need to learn about how to create a declarative xpath function in InfoPath, but not a big deal.&amp;nbsp;In addition to actually working, the other benefit will be you don&amp;#39;t need code (so less maintenance hassle).&lt;/p&gt;
&lt;p&gt;:)&amp;nbsp;&lt;/p&gt;</description></item><item><title>Big problem calculating</title><link>https://www.infopathdev.com:443/forums/thread/91628.aspx</link><pubDate>Thu, 25 Jul 2013 15:13:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91628</guid><dc:creator>drgoebel</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91628.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=91628</wfw:commentRss><description>&lt;p&gt;After updateing our Infotpath with MS Updates, this function does not work anymore (it calculates some fileds).&lt;/p&gt;&lt;p&gt;Anyone any idea?&lt;/p&gt;&lt;p&gt;Function CalcTotal()

On Error Resume Next
&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim FromTime
&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim TillTime
&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim Pause

&lt;br /&gt;&amp;nbsp;&amp;nbsp; Set configNode = XDocument.DOM.selectSingleNode(&amp;quot;/my:IZETimeSheet/my:FromTime&amp;quot;)
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FromTime = Date() &amp;amp; &amp;quot; &amp;quot; &amp;amp; configNode.text
&lt;br /&gt;&amp;nbsp;&amp;nbsp; Set configNode = XDocument.DOM.selectSingleNode(&amp;quot;/my:IZETimeSheet/my:TillTime&amp;quot;)
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;TillTime = Date() &amp;amp; &amp;quot; &amp;quot; &amp;amp; configNode.text
&lt;br /&gt;&amp;nbsp;&amp;nbsp; 
Set configNode = XDocument.DOM.selectSingleNode(&amp;quot;/my:IZETimeSheet/my:PauseDuration&amp;quot;)
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Pause = configNode.text * 60

&lt;br /&gt;&amp;nbsp;&amp;nbsp; Set configNode = XDocument.DOM.selectSingleNode(&amp;quot;/my:IZETimeSheet/my:Total&amp;quot;)
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;configNode.text = cdbl(FormatNumber(round((Datediff(&amp;quot;n&amp;quot;,FromTime,TillTime)-Pause)/60,2),3))
&lt;br /&gt;&amp;nbsp;&amp;nbsp; configNode.text = Replace(configNode.text,&amp;quot;,&amp;quot;,&amp;quot;.&amp;quot;)

&lt;br /&gt;End Function&lt;/p&gt;</description></item></channel></rss>