<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80571.aspx</link><pubDate>Fri, 13 Jul 2012 15:09:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80571</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80571.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80571</wfw:commentRss><description>&lt;p&gt;That is a great link - thanks for sharing it!&lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80563.aspx</link><pubDate>Fri, 13 Jul 2012 11:55:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80563</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80563.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80563</wfw:commentRss><description>Hilary was right. For some reason on with a load event you can&amp;#39;t close an application through script. I&amp;#39;m sure there is a reason for it. I found this site that provides events that don&amp;#39;t work in the load event if anyone is interested: http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formevents.loading(v=office.11).aspx</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80557.aspx</link><pubDate>Fri, 13 Jul 2012 01:50:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80557</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80557.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80557</wfw:commentRss><description>Removed, replied having missed to notice the posts on 2nd page</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80548.aspx</link><pubDate>Thu, 12 Jul 2012 21:34:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80548</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80548.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80548</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m assuming that the same underlying issue will be present in IP 2003 with script - that we just aren&amp;#39;t allowed to close the application while it is loading.&lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80547.aspx</link><pubDate>Thu, 12 Jul 2012 21:27:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80547</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80547.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80547</wfw:commentRss><description>I don&amp;#39;t get any errors. I&amp;#39;d prefer the loading event that way it will close the form if it loads with an invalid database. I&amp;#39;m also using IP2003 with vbs if that matters. If I can&amp;#39;t do it in the load event, I&amp;#39;ll just have to live with it.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80546.aspx</link><pubDate>Thu, 12 Jul 2012 21:17:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80546</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80546.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80546</wfw:commentRss><description>&lt;p&gt;Oh. In the Loading event. Well, I tried it in a loading event (IP 2010, Filler, C#) and had an error:&lt;/p&gt;
&lt;p&gt;System.Runtime.InteropServices.COMException&lt;br /&gt;Invalid context for OM call.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m assuming you&amp;#39;ve had errors as well?&lt;/p&gt;
&lt;p&gt;So - the error means that we can&amp;#39;t use this method in the loading event. I&amp;#39;m not super surprised by that. Perhaps just switch to a read only view or something?&lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80543.aspx</link><pubDate>Thu, 12 Jul 2012 21:06:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80543</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80543.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80543</wfw:commentRss><description>No I am not prompted. I have tried that code as well. All the ones I&amp;#39;ve tried are: &lt;br /&gt;
Application.ActiveWindow.Close(true) &lt;br /&gt;
Application.ActiveWindow.Close(True) &lt;br /&gt;
Application.ActiveWindow.Close() &lt;br /&gt;
Application.ActiveWindow.Close() = true &lt;br /&gt;
Application.ActiveWindow.Close() = True &lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m really lost at this point because everything says they should work. It&amp;#39;s in my load event and I don&amp;#39;t know if that affects it.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80539.aspx</link><pubDate>Thu, 12 Jul 2012 20:13:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80539</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80539.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80539</wfw:commentRss><description>&lt;p&gt;Are you being prompted to save changes? Try with the force param:&lt;/p&gt;
&lt;p&gt;Application.ActiveWindow.Close(true)&lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80535.aspx</link><pubDate>Thu, 12 Jul 2012 19:36:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80535</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80535.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80535</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Hilary Stoupa:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Application.ActiveWindow.Close() I think: &lt;a href="http://msdn.microsoft.com/en-us/library/aa945466.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa945466.aspx&lt;/a&gt; &lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;

&lt;br /&gt;
That&amp;#39;s the thing it doesn&amp;#39;t work for me. I currently have this: &lt;br /&gt;
If DateDiff(&amp;quot;m&amp;quot;, lastModified, date2) = 0 Then &lt;br /&gt;
x = MsgBox(&amp;quot;You have an outdated database stored on your computer. Please close the form and download the newest database.&amp;quot;, 0, &amp;quot;Outdated Database&amp;quot;) &lt;br /&gt;
Application.ActiveWindow.Close() &lt;br /&gt;
End If
&lt;br /&gt;
&lt;br /&gt;
The if statement works because the message box shows. But for some reason it won&amp;#39;t close and I have no clue why. &lt;br /&gt;
&lt;br /&gt;

EDIT: I know that it is currently set as 0 month difference. That is so I can test that the code actually works.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80533.aspx</link><pubDate>Thu, 12 Jul 2012 19:25:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80533</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80533.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80533</wfw:commentRss><description>&lt;p&gt;Application.ActiveWindow.Close() I think: &lt;a href="http://msdn.microsoft.com/en-us/library/aa945466.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa945466.aspx&lt;/a&gt; &lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80531.aspx</link><pubDate>Thu, 12 Jul 2012 19:03:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80531</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80531.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80531</wfw:commentRss><description>If anyone knows the vbs code to close a form that would be helpful. I have an if statement based on date differences. I want the form to close when a statement is true. I have all the code already with the exception of the form close. I&amp;#39;ve tried a bunch of stuff along the lines of Application.ActiveWindow.Close = True and nothing seems to work.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80529.aspx</link><pubDate>Thu, 12 Jul 2012 18:54:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80529</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80529.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80529</wfw:commentRss><description>I figured it out. Hilary&amp;#39;s method was the easiest and I used the DateDiff function.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80517.aspx</link><pubDate>Thu, 12 Jul 2012 16:43:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80517</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80517.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80517</wfw:commentRss><description>I think I&amp;#39;m just struggling to relay my thoughts. The owner creates the database locally. Then he distributes it through email to the users who then download the database and store it locally. It&amp;#39;s basically like me creating a file putting it on a USB drive and then uploading it on everyone&amp;#39;s computer. Once it is on the other computers there is no longer a connection to me as the owner. Therefore, I think I need to do what Hilary alluded to and use a data last modified method to say whenever that value is greater than X, the form can&amp;#39;t submit.</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80515.aspx</link><pubDate>Thu, 12 Jul 2012 16:30:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80515</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80515.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80515</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;shep123:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;When a new database gets sent out the user downloads it from the email/other distribution and saves it to their local computer in place of the old database. Ideally, the form would reject the database if it isn&amp;#39;t updated. I&amp;#39;m guessing the best way to do that would be use a &amp;quot;last updated&amp;quot; method&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is database updated&lt;b&gt; (Update: by users)&lt;/b&gt; locally?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;If the answer is &amp;quot;no&amp;quot;, then just show it from central location (shared folder ) to all&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If &amp;quot;yes&amp;quot;, how the databases are syncronized without server involvement?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;How will Infopath form know about database being up-to-update without checking it on a central location (server)?&lt;br /&gt;This undermines off-line use, if a database useis being blocked by absence of response from a central location (server)&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Database Update</title><link>https://www.infopathdev.com:443/forums/thread/80512.aspx</link><pubDate>Thu, 12 Jul 2012 15:54:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80512</guid><dc:creator>shep123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80512.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80512</wfw:commentRss><description>I found some code online that I could use. It was in VBA so I did some minor edits, I still have a form code error. I guess I would put this code (when it works) in the form load event and have it trigger an action that blocks use of form instead of displaying that message box. Am I going in the right direction or completely wrong? &lt;br /&gt;
 &lt;br /&gt;


Sub GetDateLastModified() &lt;br /&gt;
&lt;br /&gt;
    Dim oFS &lt;br /&gt;
    Dim strFilename &lt;br /&gt;
 &lt;br /&gt;
     strFilename = &amp;quot;c:\temp\fileA.xls&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   
    Set oFS = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;) &lt;br /&gt;
 &lt;br /&gt;
    x = MsgBox(strFilename &amp;amp; &amp;quot; was last modified on &amp;quot; &amp;amp; oFS.GetFile(strFilename).Datelastmodified, 0, &amp;quot;prompt&amp;quot;)

 &lt;br /&gt;
 &lt;br /&gt;
    Set oFS = Nothing &lt;br /&gt;
 &lt;br /&gt;
End Sub</description></item></channel></rss>