<?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: How to set focus to a specific control</title><link>https://www.infopathdev.com:443/forums/thread/21461.aspx</link><pubDate>Wed, 04 Jul 2007 18:59:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21461</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21461.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21461</wfw:commentRss><description>Unfortunately, I have never heard of someone figuring this out.&amp;nbsp; If you do, please let us know!</description></item><item><title>How to set focus to a specific control</title><link>https://www.infopathdev.com:443/forums/thread/21358.aspx</link><pubDate>Fri, 29 Jun 2007 22:23:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21358</guid><dc:creator>stpowell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21358.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21358</wfw:commentRss><description>&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I have done some research and found the following code can be used to set focus to a control that is bound to a data source.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:'Courier New';"&gt;Private&lt;/span&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; SetFieldFocus(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; xpath &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:blue;"&gt;Dim&lt;/span&gt; textNode &lt;span style="color:blue;"&gt;As&lt;/span&gt; XPathNavigator = CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CurrentView.SelectText(textNode)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;End Sub&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I tested it and it works; however it will not work if I set the form to be &amp;ldquo;Browser Compatibility&amp;rdquo;.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;The message I get is:&lt;span&gt;&amp;nbsp; &lt;/span&gt;&amp;#39;SelectText&amp;#39; is not a member of &amp;#39;Microsoft.Office.InfoPath.View&amp;#39;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I am coding in VB and using InfoPath 2007 and SharePoint MOSS 2007.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Dose anyone know how I can set focus to a control that is bound to a data source in a browser compatible form?&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Thank you,&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing" style="margin:0in 0in 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Steve&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>