<?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>Replace VB code to change characters</title><link>https://www.infopathdev.com:443/forums/thread/66730.aspx</link><pubDate>Sat, 21 May 2011 18:53:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66730</guid><dc:creator>rev_ollie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66730.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66730</wfw:commentRss><description>Hi,

I&amp;#39;m doing some general IT odd jobs and one of the tasks is using Infopath. The problem is the back end system they use uses / in dates - however when the form is filled in a variety of characters are used - mainly .
&lt;br /&gt;
&lt;br /&gt;
In order to automate it I wanted to add VB validate code to the box that would replace &amp;quot;.&amp;quot; with &amp;quot;/&amp;quot;.
I have never used VB or info path so in kinda deep here. 
&lt;br /&gt;
&lt;br /&gt;
I have the following which I tried to use (on a test form - just 1 input box) - probably not right:
&lt;br /&gt;
&lt;br /&gt;
Public Sub field1_Validating(ByVal sender As Object, ByVal e As XmlValidatingEventArgs)
            document.write(Replace(txt, &amp;quot;.&amp;quot;, &amp;quot;/&amp;quot;))
        End Sub
&lt;br /&gt;
&lt;br /&gt;
The box is formatted to date. Here are the issues:&lt;br /&gt;
1 - If I enter the data as 10.10.05 - It updates the full stops - but also the date i.e it changes from 10.10.05 to 30/12/1899??
&lt;br /&gt;&lt;br /&gt;
2 - If i enter the date as 10.10.2005 - the box goes red indicating the formatting is wrong...and non of the characters change. 
&lt;br /&gt;&lt;br /&gt;
3 - If I then change it to a standard text box - nothing happens at all.
&lt;br /&gt;&lt;br /&gt;
Any ideas??
Seems very simple I&amp;#39;m sure but to me this is all new!
&lt;br /&gt;&lt;br /&gt;
Thanks for you time</description></item></channel></rss>