B
Buddyguy
hey everyone i am still very new to this and I have an infopath form created
with the tools for office. and the submit button has the following code
im xpath As String = "/my:group1/my:group2/my:ExpenseDetails"
Dim oNodeList As IXMLDOMNodeList
Dim oNode As IXMLDOMNode
Dim oField As IXMLDOMNode
Dim txtID = thisXDocument.DOM.selectSingleNode("/my:txtID")
Dim txtexpdate = thisXDocument.DOM.selectSingleNode("/my:txtexpdate")
Dim txtOrgadd = thisXDocument.DOM.selectSingleNode("/my:txtOrgadd")
Dim txtOrgmun = thisXDocument.DOM.selectSingleNode("/my:txtOrgmun")
Dim txtDesadd = thisXDocument.DOM.selectSingleNode("/my:txtDesadd")
Dim txtDesmun = thisXDocument.DOM.selectSingleNode("/my:txtDesmun")
Dim txtPurpose = thisXDocument.DOM.selectSingleNode("/my:txtPurpose")
Dim txtKM = thisXDocument.DOM.selectSingleNode("/my:txtKM")
Dim txtNMdesc = thisXDocument.DOM.selectSingleNode("/my:txtNMdesc")
Dim txtExpamt = thisXDocument.DOM.selectSingleNode("/my:txtExpamt")
Dim txtRegKM = thisXDocument.DOM.selectSingleNode("/my:txtRegKM")
Dim txtKMrateReg = thisXDocument.DOM.selectSingleNode("/my:txtKMrateReg")
Dim txtKMrateXS = thisXDocument.DOM.selectSingleNode("/my:txtKMrateXS")
Dim txtMilCalc = thisXDocument.DOM.selectSingleNode("/my:txtMilCalc")
oNodeList = thisXDocument.DOM.selectNodes(xpath)
If (oNodeList.length > 0) Then
For Each oNode In oNodeList
If (oNode.nodeType = DOMNodeType.NODE_ELEMENT) Then
txtID.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ItemId")
txtexpdate.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ExpenseDate")
txtOrgadd.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myrigAddress")
txtOrgmun.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myrigMuncipality")
txtDesadd.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myesAddress")
txtDesmun.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myesMunicipality")
txtPurpose.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myurpose")
txtKM.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KM")
txtNMdesc.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:NonMileageExp")
txtExpamt.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ExpenseAmt")
txtRegKM.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:RegKM")
txtKMrateReg.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KMRateReg")
txtKMrateXS.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KMRateExcess")
txtMilCalc.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:MileageCalc")
End If
For Each WebServiceAdp As WebServiceAdapter2 In thisXDocument.DataAdapters
If WebServiceAdp.Name = "Submit" Then
WebServiceAdp.Submit()
End If
Next
Next
End If
what is happening is when i press the submit button i get a catastrophic
error and it points to this line
Dim txtID = thisXDocument.DOM.selectSingleNode("/my:txtID")
saying that thisxdocument caused the error.
whats going on???
thanks in advance
with the tools for office. and the submit button has the following code
im xpath As String = "/my:group1/my:group2/my:ExpenseDetails"
Dim oNodeList As IXMLDOMNodeList
Dim oNode As IXMLDOMNode
Dim oField As IXMLDOMNode
Dim txtID = thisXDocument.DOM.selectSingleNode("/my:txtID")
Dim txtexpdate = thisXDocument.DOM.selectSingleNode("/my:txtexpdate")
Dim txtOrgadd = thisXDocument.DOM.selectSingleNode("/my:txtOrgadd")
Dim txtOrgmun = thisXDocument.DOM.selectSingleNode("/my:txtOrgmun")
Dim txtDesadd = thisXDocument.DOM.selectSingleNode("/my:txtDesadd")
Dim txtDesmun = thisXDocument.DOM.selectSingleNode("/my:txtDesmun")
Dim txtPurpose = thisXDocument.DOM.selectSingleNode("/my:txtPurpose")
Dim txtKM = thisXDocument.DOM.selectSingleNode("/my:txtKM")
Dim txtNMdesc = thisXDocument.DOM.selectSingleNode("/my:txtNMdesc")
Dim txtExpamt = thisXDocument.DOM.selectSingleNode("/my:txtExpamt")
Dim txtRegKM = thisXDocument.DOM.selectSingleNode("/my:txtRegKM")
Dim txtKMrateReg = thisXDocument.DOM.selectSingleNode("/my:txtKMrateReg")
Dim txtKMrateXS = thisXDocument.DOM.selectSingleNode("/my:txtKMrateXS")
Dim txtMilCalc = thisXDocument.DOM.selectSingleNode("/my:txtMilCalc")
oNodeList = thisXDocument.DOM.selectNodes(xpath)
If (oNodeList.length > 0) Then
For Each oNode In oNodeList
If (oNode.nodeType = DOMNodeType.NODE_ELEMENT) Then
txtID.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ItemId")
txtexpdate.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ExpenseDate")
txtOrgadd.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myrigAddress")
txtOrgmun.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myrigMuncipality")
txtDesadd.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myesAddress")
txtDesmun.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myesMunicipality")
txtPurpose.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/myurpose")
txtKM.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KM")
txtNMdesc.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:NonMileageExp")
txtExpamt.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:ExpenseAmt")
txtRegKM.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:RegKM")
txtKMrateReg.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KMRateReg")
txtKMrateXS.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:KMRateExcess")
txtMilCalc.text =
oNode.selectSingleNode("/my:group1/my:group2/my:ExpenseDetails/my:MileageCalc")
End If
For Each WebServiceAdp As WebServiceAdapter2 In thisXDocument.DataAdapters
If WebServiceAdp.Name = "Submit" Then
WebServiceAdp.Submit()
End If
Next
Next
End If
what is happening is when i press the submit button i get a catastrophic
error and it points to this line
Dim txtID = thisXDocument.DOM.selectSingleNode("/my:txtID")
saying that thisxdocument caused the error.
whats going on???
thanks in advance