<?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: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/103023.aspx</link><pubDate>Mon, 29 Jun 2015 13:36:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103023</guid><dc:creator>SearchKnowledge</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103023.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=103023</wfw:commentRss><description>I tried your method for setting the value but it didn&amp;#39;t work for me :/ (This worked after some more testing.)</description></item><item><title>Re: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44203.aspx</link><pubDate>Mon, 13 Jul 2009 12:19:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44203</guid><dc:creator>Gagan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44203.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44203</wfw:commentRss><description>&lt;p&gt;oh i figured it out, my code was not exactly the same as hillary&amp;#39;s. dumb mistake actually, the code worked perfectly, thanks!&lt;/p&gt;</description></item><item><title>Re: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44143.aspx</link><pubDate>Fri, 10 Jul 2009 17:08:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44143</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44143.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44143</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;The only way I can seem to reproduce that particular error is if I do SetValue(&amp;quot;&amp;quot;) directly on &lt;i&gt;root&lt;/i&gt; (i.e. the object returned from &lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;"&gt;MainDataSource.CreateNavigator()&lt;/span&gt;&lt;/b&gt; ).&amp;nbsp; Did you use Hilary&amp;#39;s code exactly the way it is or did you modify it somehow?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44137.aspx</link><pubDate>Fri, 10 Jul 2009 15:46:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44137</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44137.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44137</wfw:commentRss><description>&lt;p&gt;Interesting. It works in my sample form. What event are you using the code in? Is the name of your field that you are trying to set to blank really &amp;#39;my:textbox&amp;#39;?&lt;/p&gt;</description></item><item><title>Re: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44136.aspx</link><pubDate>Fri, 10 Jul 2009 15:35:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44136</guid><dc:creator>Gagan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44136.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44136</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;thanks for your super-fast response. unfortunetly when i use your code, debugger gives me the following error.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;{&amp;quot;Operation is not valid due to the current position of the navigator.&amp;quot;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;any clue what that means?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>Re: clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44131.aspx</link><pubDate>Fri, 10 Jul 2009 14:46:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44131</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44131.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44131</wfw:commentRss><description>&lt;p&gt;Hi--&lt;/p&gt;
&lt;p&gt;Infopath doesn&amp;#39;t provide programatic access to the form controls, only the data. Not sure what your data field is named, but if it really is named &amp;#39;textbox&amp;#39;, and assuming that you are using VB.NET and InfoPath 2007 (since you specifiy VSTA) you&amp;#39;d want to use something like:&lt;/p&gt;
&lt;blockquote&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;Dim&lt;/span&gt; root &lt;span style="COLOR:blue;"&gt;As&lt;/span&gt; XPathNavigator = MainDataSource.CreateNavigator()&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&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;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;Dim&lt;/span&gt; textbox &lt;span style="COLOR:blue;"&gt;As&lt;/span&gt; XPathNavigator = root.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:myFields/my:textbox&amp;quot;&lt;/span&gt;, NamespaceManager)&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-no-proof:yes;"&gt;&amp;nbsp;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-no-proof:yes;"&gt;textbox.SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/blockquote&gt;</description></item><item><title>clearing out a text box with code</title><link>https://www.infopathdev.com:443/forums/thread/44129.aspx</link><pubDate>Fri, 10 Jul 2009 14:36:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44129</guid><dc:creator>Gagan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44129.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=44129</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m used to visual basic and not VSTA, but ive been trying to use this code to clear some text boxes when a user hits submit.&lt;/p&gt;&lt;font size="2"&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = MainDataSource.CreateNavigator()&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; textbox &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:myFields/my:textbox&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value&lt;/font&gt;&lt;br /&gt;with me&lt;br /&gt;textbox = &amp;quot;&amp;quot;&lt;br /&gt;end with&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;usually in visual basic i can say textbox.clear() but that does not work in VSTA, also the code i posted does not clear it either. any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>