Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2008

Tip: Looking for answers? Try searching our database.

catastrophic error in infopath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Buddyguy - 08 Apr 2008 23:11 GMT
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
Gavin McKay - 09 Apr 2008 00:29 GMT
Hello,

I'm assuming that you are using InfoPath 2003...

Can you tell what the contents of thisXDocument are?  Is it null or has it
been set properly by InfoPath?  Usually you would get this error when
thisXDocument isn't set, so therefore it has no "DOM" method/property.

Gavin.
Signature

2B | !2B

> 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
[quoted text clipped - 119 lines]
>
> thanks in advance
Buddyguy - 09 Apr 2008 01:56 GMT
HI Gavin,

i looked at that and at the beginning of the code it declares xdocument.  
when i am in tommorow i will send you the code.

Thanks

Arley

> Hello,
>
[quoted text clipped - 129 lines]
> >
> > thanks in advance
Gavin McKay - 09 Apr 2008 02:08 GMT
No worries Arley, send it through whenever.  I found this MS article which
might help as a starting point:

http://msdn2.microsoft.com/en-us/library/aa947932.aspx

By the looks of your code though I think you already have this covered.

Gavin.
Signature

2B | !2B

> HI Gavin,
>
[quoted text clipped - 138 lines]
> > >
> > > thanks in advance
Buddyguy - 09 Apr 2008 21:25 GMT
ok here is the code where it declares xdocument
       Private thisXDocument As XDocument
       Private thisApplication As Application

       'Declare object for shared code
       Private objShared As cscShared.InfoPathTools

       Public Sub _Startup(ByVal app As Application, ByVal doc As XDocument)
           thisXDocument = doc
           thisApplication = app

           ' You can add additional initialization code here.
       End Sub

> No worries Arley, send it through whenever.  I found this MS article which
> might help as a starting point:
[quoted text clipped - 147 lines]
> > > >
> > > > thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.