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 / January 2008

Tip: Looking for answers? Try searching our database.

Return single node value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Humphrey - 04 Jan 2008 01:59 GMT
I know this is going to be a great DOH!! moment but how do I return the value
in a field from my document in 2007?  My code is as follows,

           Dim StandardJobName As XPathNavigator =
Me.MainDataSource.CreateNavigator()
           Msg =
StandardJobName.SelectSingleNode("/my:myFields/my:StandardJobName",
Me.NamespaceManager).Value
           MessageBox.Show(Msg, "Standard Job Title")

but it keeps giving errors and does not return the value in the field.  Can
someone point me in the right direction?

H
S.Y.M. Wong-A-Ton - 04 Jan 2008 05:50 GMT
What kind of errors?
---
S.Y.M. Wong-A-Ton

> I know this is going to be a great DOH!! moment but how do I return the value
> in a field from my document in 2007?  My code is as follows,
[quoted text clipped - 10 lines]
>
> H
Humphrey - 05 Jan 2008 00:44 GMT
No idea since the err.number, err.description I'm use to in VBA doesn't seem
to work.  All I know is that the code goes via the ErrorHandler: displays a
message that it is in there and then the Resume Next continues the code.
Could we start with how to display error details in VB?

H

> What kind of errors?
> ---
[quoted text clipped - 14 lines]
> >
> > H
S.Y.M. Wong-A-Ton - 05 Jan 2008 01:35 GMT
Sure, but please keep in mind that that's not InfoPath-related and the best
place to ask such questions is in one of the .NET newsgroups. We try to limit
the questions posted here to InfoPath.

Put your code between a try-catch block as follows:

Try
 ' Code goes here
Catch ex As Exception
 Dim message As String = ex.Message
End Try

If you debug your code, you will see the error message in the "message"
variable. Alternatively, remove all error handlers that you currently have
and InfoPath should show you a message box with an error if an error takes
place.
---
S.Y.M. Wong-A-Ton

> No idea since the err.number, err.description I'm use to in VBA doesn't seem
> to work.  All I know is that the code goes via the ErrorHandler: displays a
[quoted text clipped - 21 lines]
> > >
> > > H
Humphrey - 05 Jan 2008 02:05 GMT
Thanks I'll test that out.  But do you see any problem with my original
InfoPath code?

> Sure, but please keep in mind that that's not InfoPath-related and the best
> place to ask such questions is in one of the .NET newsgroups. We try to limit
[quoted text clipped - 40 lines]
> > > >
> > > > H
S.Y.M. Wong-A-Ton - 05 Jan 2008 03:14 GMT
No, it looked fine to me. That's why I asked what kind of errors.
---
S.Y.M. Wong-A-Ton

> Thanks I'll test that out.  But do you see any problem with my original
> InfoPath code?
[quoted text clipped - 43 lines]
> > > > >
> > > > > H
 
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.