Hi,
I'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 .
In order to automate it I wanted to add VB validate code to the box that would replace "." with "/".
I have never used VB or info path so in kinda deep here.
I have the following which I tried to use (on a test form - just 1 input box) - probably not right:
Public Sub field1_Validating(ByVal sender As Object, ByVal e As XmlValidatingEventArgs)
document.write(Replace(txt, ".", "/"))
End Sub
The box is formatted to date. Here are the issues:
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??
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.
3 - If I then change it to a standard text box - nothing happens at all.
Any ideas??
Seems very simple I'm sure but to me this is all new!
Thanks for you time