<?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: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/51110.aspx</link><pubDate>Thu, 28 Jan 2010 19:11:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51110</guid><dc:creator>mganci350</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51110.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=51110</wfw:commentRss><description>&lt;p&gt;So far what we do know is that it is happening with C#&amp;nbsp;or &amp;nbsp;Jscript and Infopath 2003 and Infopath 2007. I wonder if it could be a bug?&lt;/p&gt;
&lt;p&gt;A work around is to is to use the &amp;quot;Add Record&amp;quot; Hyperlink in the corner of the table. This seems to work ok.&lt;/p&gt;
&lt;p&gt;Rico, do you have a master/detail query?&lt;/p&gt;
&lt;p&gt;I am using master/detail.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50976.aspx</link><pubDate>Mon, 25 Jan 2010 15:10:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50976</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50976.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50976</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;I was wondering if there&amp;#39;s a fix to the issue I&amp;#39;m having right now with my form where I modified my &amp;quot;Run Query&amp;quot; button. I thought it was already perfect but then I read this &lt;a class="" title="Error with New Record after running modified Run Query" href="http://www.infopathdev.com/forums/p/14296/50920.aspx#50920"&gt;thread&lt;/a&gt; and found out indeed this error &amp;quot;The Structure of the Datafield Group has been changed and no longer matches the structure of the data source&amp;quot; pops up everytime you run the modified Run Query, make changes to data, submitting the form then&amp;nbsp;use the New Record button and submit a new one.&lt;/p&gt;
&lt;p&gt;Have you tried this&amp;nbsp;with your modified &amp;quot;Run Query&amp;quot; button? Hope there&amp;#39;s a solution for this issue. Any help will be much appreciated. Thanks.&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50713.aspx</link><pubDate>Tue, 19 Jan 2010 02:42:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50713</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50713.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50713</wfw:commentRss><description>&lt;p&gt;Thanks Hilary. I Got it working already. I hope you guys don&amp;#39;t get tired helping us newbies. :)&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50709.aspx</link><pubDate>Tue, 19 Jan 2010 01:14:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50709</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50709.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50709</wfw:commentRss><description>&lt;p&gt;You&amp;#39;ll probably need to use some string functions to split up your original query and put it back together so that you can put your WHERE clause before your ORDER BY clause. Holler if you get stuck.&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50703.aspx</link><pubDate>Mon, 18 Jan 2010 19:14:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50703</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50703.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50703</wfw:commentRss><description>&lt;p&gt;Hi Jimmy,&lt;/p&gt;
&lt;p&gt;You&amp;#39;re absolutely right! Oh well, I guess I have to brush up on my SQL then. :)&lt;/p&gt;
&lt;p&gt;Thank you so much.&lt;/p&gt;
&lt;p&gt;- Ric&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50702.aspx</link><pubDate>Mon, 18 Jan 2010 18:15:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50702</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50702.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50702</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ms189499.aspx"&gt;http://technet.microsoft.com/en-us/library/ms189499.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; Looks like that&amp;#39;s happening because you&amp;#39;re trying to insert the WHERE clause after the ORDER BY clause.&amp;nbsp; That&amp;#39;s not correct syntax, as far as I know.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50701.aspx</link><pubDate>Mon, 18 Jan 2010 17:29:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50701</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50701.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50701</wfw:commentRss><description>&lt;p&gt;Hi&amp;nbsp;Hilary,&amp;nbsp;Sorry to be&amp;nbsp;back so soon! Guess what? :)&lt;/p&gt;
&lt;p&gt;Yeah,&amp;nbsp;I&amp;#39;m running into a problem. Since I&amp;#39;m using C#, I referred to this &lt;a class="" title="Old thread" href="http://www.infopathdev.com/forums/t/8940.aspx" target="_blank"&gt;thread&lt;/a&gt;&amp;nbsp;instead of the one with Microsoft. I studied the discussion and followed all your instructions including the use of first and second half substring manipulation. However, I&amp;#39;m getting this error when I click Run Query button:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Failed connection to data source: InfoPath cannot connect to a data source.&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The query cannot be run for the following DataObject: Main connection&lt;br /&gt;InfoPath cannot run the specified query.&lt;br /&gt;[0x80040E14][Microsoft Office Access Database Engine] Syntax error (missing operator) in query expression &amp;#39;[Version] where ([ProjectName] like &amp;#39;Data%&amp;#39;)&amp;#39;.&lt;br /&gt;[0x80040E14][MSDataShape] Data provider failed while executing a provider command.&lt;/p&gt;
&lt;p&gt;A required data source is not available.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Here&amp;#39;s&amp;nbsp;my&amp;nbsp;code for the button:&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;public void btnRunQuery_Clicked(object sender, ClickedEventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;//get the value of the query field we want to use with a wild card&lt;br /&gt;&amp;nbsp;XPathNavigator queryField = MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/q:tblProjects/@ProjectName&amp;quot;, NamespaceManager);&lt;br /&gt;&amp;nbsp;string querySeed = queryField.Value;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//clear the query field so that it is ignored in the query&lt;br /&gt;&amp;nbsp;queryField.SetValue(&amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//create our custom where clause -- you have some choices here. I&amp;#39;ve added in the wildcard. You could choose not to, if your users are savvy and can fill it in themselves when searching, all up to you.&lt;br /&gt;&amp;nbsp;string customQuery = &amp;quot; where ([ProjectName] like &amp;#39;&amp;quot; + querySeed + &amp;quot;%&amp;#39;)&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//get the original command (we&amp;#39;ll need to set it back)&lt;br /&gt;&amp;nbsp;AdoQueryConnection newQuery = (AdoQueryConnection)MainDataSource.QueryConnection;&lt;br /&gt;&amp;nbsp;string origCommand = newQuery.Command.ToString();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//set the query to use the custom command&lt;br /&gt;&amp;nbsp;int firstBrace = origCommand.IndexOf(&amp;quot;}&amp;quot;);&lt;br /&gt;&amp;nbsp;string origCommand1stHalf = origCommand.Substring(0, firstBrace);&lt;br /&gt;&amp;nbsp;string origCommand2ndHalf = origCommand.Substring(firstBrace,origCommand.Length-origCommand1stHalf.Length);&lt;br /&gt;&amp;nbsp;newQuery.Command = origCommand1stHalf + customQuery + origCommand2ndHalf;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//annnnnnddddd, now we run the query using our shiny new command&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;newQuery.Execute();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//put everything back the way it was.... you&amp;#39;re going to need it!&lt;br /&gt;&amp;nbsp;newQuery.Command = origCommand;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;//set the query field back for the user, so they know what they typed in!&lt;br /&gt;&amp;nbsp;queryField.SetValue(querySeed);&lt;br /&gt;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Here&amp;#39;s my OrigCommand string:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;shape&lt;br /&gt;{select [ProjectID],[ProjectNo],[ProjectName],[ProjectDesc],[Version],[Active] from [tblProjects] as [tblProjects] order by [ProjectName],[Version]} as [tblProjects]&lt;br /&gt;&amp;nbsp;append&lt;br /&gt;&amp;nbsp;((shape&lt;br /&gt;&amp;nbsp;{select [AssetID],[AssetNo],[AssetName],[ProjectID],[AssetClassID],[AssetValue],[IntRate],[YrStarted],&lt;br /&gt;&amp;nbsp;[YrCapitalized],[YrAmortized],[RegionID],[DeptID],[CostCentreID] from [tblAssetsMaster]}&lt;br /&gt;&amp;nbsp;&amp;nbsp;append&lt;br /&gt;&amp;nbsp;&amp;nbsp;({select [AssetDetailID],[AssetID],[FYear],[NBV],[Amort],[Interest] from [tblAssetsDetail]}&lt;br /&gt;&amp;nbsp;&amp;nbsp;relate [AssetID] TO [AssetID]) as [tblAssetsDetail])&lt;br /&gt;&amp;nbsp;relate [ProjectID] TO [ProjectID]) as [tblAssetsMaster]&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Here&amp;#39;s my CustomQuery string:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;where ([ProjectName] like &amp;#39;Data%&amp;#39;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Everything seems correct but it&amp;#39;s not. When I don&amp;#39;t add customQuery string to the newQuery.Command, I don&amp;#39;t get the error... but ofcourse I don&amp;#39;t get the result I want.&amp;nbsp;What am I missing here? Thanks.&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50697.aspx</link><pubDate>Mon, 18 Jan 2010 15:19:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50697</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50697.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50697</wfw:commentRss><description>&lt;p&gt;Thank you so much Hilary. I really don&amp;#39;t know how I would ever survive without you. You&amp;#39;ve been a great help to&amp;nbsp;me and I&amp;#39;m very grateful for this.&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;
&lt;p&gt;- Ric&lt;/p&gt;</description></item><item><title>Re: How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50681.aspx</link><pubDate>Sun, 17 Jan 2010 23:59:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50681</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50681.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50681</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/826992"&gt;Here&amp;#39;s&lt;/a&gt; a sample at Microsoft that uses script. It wouldn&amp;#39;t be too tricky to update to managed code. &lt;a href="http://www.infopathdev.com/forums/t/8940.aspx"&gt;Here&amp;#39;s&lt;/a&gt; a thread on this forum with some additional information that might help you.&lt;/p&gt;If you need more help than these resources provide, please post back!</description></item><item><title>How to modify "Run Query" button functionality</title><link>https://www.infopathdev.com:443/forums/thread/50649.aspx</link><pubDate>Fri, 15 Jan 2010 17:29:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50649</guid><dc:creator>ricomarcelo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50649.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=50649</wfw:commentRss><description>&lt;p&gt;Hi Everybody,&lt;/p&gt;
&lt;p&gt;I have a form based on an Access database with related tables. InfoPath automatically added the Run Query button. Everything works fine except that in order for me to retrieve a record, the query field must contain an exact match. What I would want is for example I enter &amp;quot;infopath&amp;quot; in the ProjectName query field, the result will include all records with ProjectName containing the string &amp;quot;infopath&amp;quot;. Any help would be greatly appreciated. Thanks!&lt;/p&gt;
&lt;p&gt;Ric&lt;/p&gt;</description></item></channel></rss>