Hi all,
I'm currently trying to set a field to 1 when another field is changed. All the tests in VSTA works but when I run infopath it crashes. Any help on this would be amazing!
Here's the code:
Public Sub Incoming_Agent_Login_Changed(ByVal sender As Object, ByVal e As XmlEventArgs)
Dim node As IHTMLDOMNode
node = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Retrieve_Info", NamespaceManager)
node.text = "1"
End Sub
And the error:
System.InvalidCastException
Unable to cast object of type 'Microsoft.Office.InfoPath.MsxmlNavigator' to type 'mshtml.IHTMLDOMNode'.
at NSTAT_v5pt5_0.FormCode.Incoming_Agent_Login_Changed(Object sender, XmlEventArgs e) in C:\Users\wilcojos\AppData\Local\Temp\vsta\1e5cd4420e40498dbbc128d44b5946e0\FormCode.vb:line 46
at Microsoft.Office.InfoPath.Internal.XmlEventHost.GenericProxy(Object genericDelegate, DataDOMEvent dataDOMEvent, InfoPathEvents type)
at Microsoft.Office.InfoPath.Internal.XmlEventHost.ChangedProxy(DataDOMEvent dataDOMEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._DataDOMEventSink_SinkHelper.OnAfterChange(DataDOMEvent pDataDOMEvent)
Been searching and searching but cannot find an answer. Thank you in advance. :)