Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5950763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:26:23+00:00 2026-05-22T17:26:23+00:00

error in Infopath: Object reference not set to an instance of an object. at

  • 0

error in Infopath:

Object reference not set to an instance of an object.
at InfoPathFormTemplate5.FormCode.CTRL407_5_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

error in VB2005: Object reference not set to an instance of an object.
System.NullReferenceException was unhandled by user code
Message=”Object reference not set to an instance of an object.”
Source=”InfoPathFormTemplate5″
StackTrace:
at InfoPathFormTemplate5.FormCode.CTRL407_5_Clicked(Object sender, ClickedEventArgs e) in C:\Documents and Settings\pebabczu\Desktop\IntakeForm Copy\InfoPathFormTemplate5\FormCode.cs:line 206
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

Code:

string TeamL = xnMyForm.SelectSingleNode("/my:myFields/my:field149", ns).Value;
string ACC = xnMyForm.SelectSingleNode("/my:myFields/my:Bank", ns).Value;
string remarkmain = xnMyForm.SelectSingleNode("/my:myFields/my:field104", ns).Value;
string RemarkHR = xnMyForm.SelectSingleNode("/my:myFields/my:Remarks1", ns).Value;
string RemarkTL = xnMyForm.SelectSingleNode("/my:myFields/my:field55", ns).Value;
string RemarkIT = xnMyForm.SelectSingleNode("/my:myFields/my:RemarksICT", ns).Value;
string Rmain = "Remarks: " + remarkmain;
string RHR = "Remarks: " + RemarkHR;
string RTL = "Remarks: " + RemarkTL;
string RIT = "Remarks: " + RemarkIT;

I dont get it… Just getting into C# what did I do wrong.?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:26:24+00:00Added an answer on May 22, 2026 at 5:26 pm

    Well, you’re dereferencing something that turns out to be null.

    It’s hard to say exactly which line of code is problematic out of what you posted, but you should look at line 206. I strongly suspect that SelectSingleNode is returning null for one of your XPath expressions – you’re then trying to access the Value property, which is causing the exception.

    So, you need to:

    • Work out which line is causing the problem
    • Find out whether it’s because the data is wrong or your XPath query
    • Consider putting in a nullity check before accessing the value (if you should really, really always find a node, then an exception may well be the right approach already)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error in NSLog: *** -[NSThread initWithTarget:selector:object:]: target does not implement selector (*** -[Document myTcpClient])
I'm developping a workflow with MOSS 2007 and infopath and I got this error
I am using InfoPath 2007 to send out a survey (it is not connected
Error : 'string' does not contain a definition for 'SelectedPath' and no extension method
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of
Error on link: ld: duplicate symbol _OBJC_METACLASS_$_Reachability in /Users/jmf/Documents/iOS Development/jmf_Client/jmf/jmf/ww_libs/libmfcbroem_ios.a(Reachability.o) and /Users/tpf/Library/Developer/Xcode/DerivedData/jmf-erlknghfcpoomnfanzovahfacgpv/Build/Intermediates/jmf.build/Debug-iphoneos/jmf.build/Objects-normal/armv7/Reachability.o for architecture
Error display as Incorrect syntax near '@Cmp_DocPath', if i use comment Line code I
Error I have a web app with a mass uploader (Plupload) for photos and
Error: undefined method `author' for nil:NilClass In my helper: def last_updated(group) g = group.last_updated_version
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.