sorry, in last line it is strCustID.
CustID.SetValue(strCustID);
There's no way to tell for sure from your code, but the null object reference
is probably occurring on the CustID variable because of a failure in
resolving the XPath expression. This may possibly be due to a case mismatch
or to using a different namespace prefix than InfoPath is expecting.
To double-check the XPath expression, go to the Data Sources pane, select
your CustomerNextNumber data source, expand the nodes to show your CustID
field, then select the "Copy XPath" option from the field's dropdown menu.
Then paste it into your code and compare.

Signature
David Dean
Sr. Member Technical Staff
Insource Technology Corp.
> sorry, in last line it is strCustID.
>
[quoted text clipped - 15 lines]
> > How to resolve this.
> > Thanks