<?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: Change Default Value of Text Box</title><link>https://www.infopathdev.com:443/forums/thread/41030.aspx</link><pubDate>Mon, 27 Apr 2009 23:44:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41030</guid><dc:creator>greenant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41030.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41030</wfw:commentRss><description>&lt;p&gt;Actually, all you really need is:&lt;br /&gt;&lt;br /&gt;Dim field1 As String = &amp;quot;text&amp;quot;&lt;br /&gt;Dim xNav As XPathNavigator = Me.CreateNavigator()&lt;br /&gt;Dim&amp;nbsp;ns As XmlNamespaceManager = Me.NamespaceManager&lt;br /&gt;&lt;br /&gt;xNav.SelectSingleNode(&amp;quot;/my:MyFields/my:Text_Field&amp;quot;, ns).SetValue(field1)&lt;br /&gt;&lt;br /&gt;The other stuff was related to my project.&lt;/p&gt;</description></item><item><title>Re: Change Default Value of Text Box</title><link>https://www.infopathdev.com:443/forums/thread/41029.aspx</link><pubDate>Mon, 27 Apr 2009 23:40:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41029</guid><dc:creator>greenant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41029.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41029</wfw:commentRss><description>&lt;p&gt;Thanks for the reply.&lt;br /&gt;I have sorted the problem out ... kind of.&lt;br /&gt;&lt;br /&gt;I was too busy looking outside the square to solve my problem, when really it was much simpler.&lt;br /&gt;&lt;br /&gt;All I had to do was figure out the code to assign&amp;nbsp;a value to the text field. It didn&amp;#39;t need to be the default value at all.&lt;br /&gt;I was at one point hoping to achieve this without using code, and thought the default value was the only way to achieve it without code.&lt;br /&gt;&lt;br /&gt;As it turned out I needed code for something else, so once I got into the coding of it, setting the value worked&lt;br /&gt;&lt;br /&gt;My only issue now is finding how to put a line break in using code... seems simple... but it isn&amp;#39;t.&lt;br /&gt;&lt;br /&gt;Anyway, in case this helps others, here is the code for adding the text to a field through code.&lt;br /&gt;&lt;br /&gt;Dim field1 As String&lt;br /&gt;Dim field2 As String&lt;br /&gt;Dim xNav As XPathNavigator = Me.CreateNavigator()&lt;br /&gt;Dim&amp;nbsp;ns As XmlNamespaceManager = Me.NamespaceManager&lt;br /&gt;&lt;br /&gt;field1 =&amp;nbsp;field1 &amp;amp;&amp;nbsp;field2 &amp;amp; System.Environment.NewLine&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;&amp;nbsp;&amp;nbsp; The NewLine bit does not work. Am looking at a way to add a line break to a text box through code...&lt;br /&gt;xNav.SelectSingleNode(&amp;quot;/my:MyFields/my:Text_Field&amp;quot;, ns).SetValue(field1)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Change Default Value of Text Box</title><link>https://www.infopathdev.com:443/forums/thread/40993.aspx</link><pubDate>Mon, 27 Apr 2009 04:53:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40993</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40993.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40993</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hi and welcome to forums,&lt;/p&gt;
&lt;p&gt;You have two ways. &lt;/p&gt;
&lt;p&gt;a. Store the string variable in to a hidden field in the form. And add a rule to the button to set the value. Follow the below steps to do that.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Go to button properties.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. Click on Rules.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. Click Add then click Add action.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4. Select ‘set a field&amp;#39;s value&amp;#39; in action drop down, select rich text field in Field, select string value field in Value.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5. Click Ok until all the windows gets closed.&lt;/p&gt;
&lt;p&gt;b. Add a button click event and store the string variable in to rich text field. &lt;/p&gt;</description></item><item><title>Change Default Value of Text Box</title><link>https://www.infopathdev.com:443/forums/thread/40989.aspx</link><pubDate>Sun, 26 Apr 2009 23:54:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40989</guid><dc:creator>greenant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40989.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40989</wfw:commentRss><description>&lt;p&gt;Hi there,&lt;br /&gt;&lt;br /&gt;I have an Infopath form, which uses VB code to perform several advanced functions.&lt;br /&gt;&lt;br /&gt;I can get most of what I want, but am stuck on changing the default value of 3 rich text boxes.&lt;br /&gt;&lt;br /&gt;The default value should change when I click a button on the form.&lt;br /&gt;&lt;br /&gt;The value to enter comes from a string variable which I have already set up.&lt;br /&gt;&lt;br /&gt;Any ideas of how to go about this?&lt;br /&gt;&lt;br /&gt;Thanks for any help you can throw my way.&lt;/p&gt;</description></item></channel></rss>