<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14229.aspx</link><pubDate>Tue, 24 Jan 2006 20:51:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14229</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14229.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14229</wfw:commentRss><description>You might want to incorporate this function into your code.  This is a function provided with common.js and ensures that your node is always normalized.  It sounds like you need your node normalized every other record and not on the others.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;/*------------------------------------------------------------------------------&lt;br /&gt;	normalizeSource() - Ensures that we always get a node of type NODE_ELEMENT&lt;br /&gt;		or NODE_ATTRIBUTE.&lt;br /&gt;------------------------------------------------------------------------------*/&lt;br /&gt;function normalizeSource(oEvent)&lt;br /&gt;{&lt;br /&gt;	// Return the node's parent if the node is of type NODE_TEXT and its parent&lt;br /&gt;	// is of type NODE_ELEMENT&lt;br /&gt;	if (oEvent.Parent.nodeType == 1 &amp;&amp; oEvent.Source.nodeType == 3)&lt;br /&gt;		return oEvent.Parent;&lt;br /&gt;		&lt;br /&gt;	// Return the node if it is of type NODE_ELEMENT or NODE_ATTRIBUTE;&lt;br /&gt;	if (oEvent.Source.nodeType == 1 || oEvent.Source.nodeType == 2)&lt;br /&gt;		return oEvent.Source;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Glad to hear it's working at least a little now, good luck!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14228.aspx</link><pubDate>Tue, 24 Jan 2006 19:32:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14228</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14228.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14228</wfw:commentRss><description>this works&lt;br /&gt;myLocationOffloadCode = e.Parent.selectSingleNode("../@LocationOffloadCode")&lt;br /&gt;but it produces error msg for every other record returned.&lt;br /&gt;It does function correctly, as far as I can see--I set the LocationOffloadCode to Nothing, and only that record gets set.&lt;br /&gt;I can turn off the error message popup in the try statement and be functional..&lt;br /&gt;Doesn't feel good tho...</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14227.aspx</link><pubDate>Tue, 24 Jan 2006 18:03:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14227</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14227.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14227</wfw:commentRss><description>+	Me	{OffloadRequestReview.OffloadRequestReview}	OffloadRequestReview.OffloadRequestReview&lt;br /&gt;-	e	{Microsoft.Office.Interop.InfoPath.SemiTrust.DataDOMEventWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DataDOMEvent&lt;br /&gt;+	[Microsoft.Office.Interop.InfoPath.SemiTrust.DataDOMEventWrapper]	{Microsoft.Office.Interop.InfoPath.SemiTrust.DataDOMEventWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DataDOMEventWrapper&lt;br /&gt;	IsUndoRedo	False	Boolean&lt;br /&gt;	MatchExpression	"/dfs:myFields/dfs:dataFields/d:Offload_Request/@LocationID"	String&lt;br /&gt;+	NewValue	"66" {String}	Object&lt;br /&gt;+	OldValue	"73" {String}	Object&lt;br /&gt;	Operation	"Insert"	String&lt;br /&gt;+	Parent	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	ReturnMessage	Nothing	String&lt;br /&gt;	ReturnStatus	True	Boolean&lt;br /&gt;-	Site	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	[Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper]	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper&lt;br /&gt;	attributes	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMap&lt;br /&gt;	baseName	"LocationID"	String&lt;br /&gt;+	childNodes	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeList&lt;br /&gt;+	dataType	{System.DBNull}	Object&lt;br /&gt;	definition	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;-	firstChild	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	[Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper]	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper&lt;br /&gt;	attributes	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMap&lt;br /&gt;	baseName	Nothing	String&lt;br /&gt;-	childNodes	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeList&lt;br /&gt;-	[Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper]	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper&lt;br /&gt;	context	&amp;lt;error: an exception of type: {System.InvalidCastException} occurred&amp;gt;	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	expr	&amp;lt;error: an exception of type: {System.InvalidCastException} occurred&amp;gt;	String&lt;br /&gt;	Item	&amp;lt;cannot view indexed property&amp;gt;	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	length	0	Integer&lt;br /&gt;+	dataType	{System.DBNull}	Object&lt;br /&gt;	definition	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	firstChild	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	lastChild	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	namespaceURI	Nothing	String&lt;br /&gt;	nextSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	nodeName	"#text"	String&lt;br /&gt;	nodeType	NODE_TEXT	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeType&lt;br /&gt;+	nodeTypedValue	"66" {String}	Object&lt;br /&gt;	nodeTypeString	"text"	String&lt;br /&gt;+	nodeValue	"66" {String}	Object&lt;br /&gt;+	ownerDocument	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMDocument50Wrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument&lt;br /&gt;-	parentNode	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	[Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper]	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper&lt;br /&gt;	attributes	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNamedNodeMap&lt;br /&gt;	baseName	"LocationID"	String&lt;br /&gt;+	childNodes	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeListWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeList&lt;br /&gt;+	dataType	{System.DBNull}	Object&lt;br /&gt;	definition	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	firstChild	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	lastChild	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	namespaceURI	Nothing	String&lt;br /&gt;	nextSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	nodeName	"LocationID"	String&lt;br /&gt;	nodeType	NODE_ATTRIBUTE	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeType&lt;br /&gt;+	nodeTypedValue	"66" {String}	Object&lt;br /&gt;	nodeTypeString	"attribute"	String&lt;br /&gt;+	nodeValue	"66" {String}	Object&lt;br /&gt;+	ownerDocument	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMDocument50Wrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument&lt;br /&gt;	parentNode	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	parsed	True	Boolean&lt;br /&gt;	prefix	Nothing	String&lt;br /&gt;	previousSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	specified	True	Boolean&lt;br /&gt;	text	"66"	String&lt;br /&gt;	xml	"LocationID="66""	String&lt;br /&gt;	parsed	True	Boolean&lt;br /&gt;	prefix	Nothing	String&lt;br /&gt;	previousSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	specified	True	Boolean&lt;br /&gt;	text	"66"	String&lt;br /&gt;	xml	"66"	String&lt;br /&gt;+	lastChild	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	namespaceURI	Nothing	String&lt;br /&gt;	nextSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	nodeName	"LocationID"	String&lt;br /&gt;	nodeType	NODE_ATTRIBUTE	Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeType&lt;br /&gt;+	nodeTypedValue	"66" {String}	Object&lt;br /&gt;	nodeTypeString	"attribute"	String&lt;br /&gt;+	nodeValue	"66" {String}	Object&lt;br /&gt;+	ownerDocument	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMDocument50Wrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument&lt;br /&gt;	parentNode	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	parsed	True	Boolean&lt;br /&gt;	prefix	Nothing	String&lt;br /&gt;	previousSibling	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	specified	True	Boolean&lt;br /&gt;	text	"66"	String&lt;br /&gt;	xml	"LocationID="66""	String&lt;br /&gt;+	Source	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;+	XDocument	{Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument&lt;br /&gt;+	myLocationID	{Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper}	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;	myLocationOffloadCode	Nothing	Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode&lt;br /&gt;</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14226.aspx</link><pubDate>Tue, 24 Jan 2006 18:00:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14226</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14226.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14226</wfw:commentRss><description>Looking in the debugger, both e.source.parentnode and e.parent resolve to 'nothing'&lt;br /&gt;I seem to be able only to get the value of the first record returned.&lt;br /&gt;So, neither of these suggestions are working..&lt;br /&gt;e.Source.parentNode.selectSingleNode( "@LocationOffloadCode" );&lt;br /&gt;Depending on what e.Source points to you might have to "normalize" the source and use something more like this:&lt;br /&gt;e.Parent.selectSingleNode( "@LocationOffloadCode" );&lt;br /&gt;</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14225.aspx</link><pubDate>Tue, 24 Jan 2006 17:27:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14225</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14225.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14225</wfw:commentRss><description>Thanks, that worked perfectly.&lt;br /&gt;Now I just need to select the right row to change working..neither of the suggested code above worked, so I need to play around with it until it returns a value.</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14224.aspx</link><pubDate>Tue, 24 Jan 2006 05:26:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14224</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14224.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14224</wfw:commentRss><description>Sorry for missing the code. What is causing the SQL query to run? You could set some state before and after that and filter on the state. The other thing you could do is disable updates during the SQL query to prevent DOM events but only do that if you are sure the resulting DOM will be valid.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14223.aspx</link><pubDate>Tue, 24 Jan 2006 03:53:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14223</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14223.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14223</wfw:commentRss><description>Yeah, my code is in the first message.&lt;br /&gt;OnAfterChange fires twice for each record returned from the query.&lt;br /&gt;I can use e.Operation = "Insert"  to filter out half the firings, but I really need to filter out ALL the firings for the initial query return, and catch only one when the user changes the value.</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14222.aspx</link><pubDate>Mon, 23 Jan 2006 09:15:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14222</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14222.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14222</wfw:commentRss><description>Hi Rick,&lt;br /&gt;Are you using an OnAfterChange event handler?&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14221.aspx</link><pubDate>Sun, 22 Jan 2006 00:53:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14221</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14221.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14221</wfw:commentRss><description>If e.Operation = "Insert" Then&lt;br /&gt;Try&lt;br /&gt;is true when the SQL query returns data and also true when I choose a different value in the drop down listbox. So whatever action I take happens to every record returned. &lt;br /&gt;How do I differentiate between a query return and a user changing the value?</description></item><item><title>Re: Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/14220.aspx</link><pubDate>Wed, 18 Jan 2006 02:19:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14220</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14220.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14220</wfw:commentRss><description>To select the field of the specific row, try something like this:&lt;br /&gt;&lt;br /&gt;e.Source.parentNode.selectSingleNode( "@LocationOffloadCode" );&lt;br /&gt;&lt;br /&gt;Depending on what e.Source points to you might have to "normalize" the source and use something more like this:&lt;br /&gt;&lt;br /&gt;e.Parent.selectSingleNode( "@LocationOffloadCode" );&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Event firing and repeating section</title><link>https://www.infopathdev.com:443/forums/thread/12750.aspx</link><pubDate>Tue, 17 Jan 2006 02:25:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12750</guid><dc:creator>rickhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12750.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12750</wfw:commentRss><description>Using VB.Net&lt;br /&gt;I query a SQL table to populate a repeating section.&lt;br /&gt;If a user changes a value in a dropdown listbox, I use OnAfterChange to &lt;br /&gt;change another value in the current record. That seems to work fine for only &lt;br /&gt;the first record.&lt;br /&gt;Also, when I run the query, the OnAfterChange fires many times as the &lt;br /&gt;query returns records.&lt;br /&gt;I want the OnAfterChange to only execute my code when a user changes a &lt;br /&gt;specific record and to act only on that record....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; added this code--query doesn't fail, but , after more testing, I found that &lt;br /&gt;if I changed the second record returned, it still didn't work.&lt;br /&gt;&amp;lt;InfoPathEventHandler(MatchPath:="/dfs:myFields/dfs:dataFields/d:Offload_Request/@LocationID", EventType:=InfoPathEventType.OnAfterChange)&amp;gt; _&lt;br /&gt;		Public Sub Offload_Request_LocationID_attr_OnAfterChange(ByVal e As &lt;br /&gt;DataDOMEvent)&lt;br /&gt;			' Write code here to restore the global state.&lt;br /&gt;			&lt;br /&gt;			If (e.IsUndoRedo) then&lt;br /&gt;			' An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;				Return&lt;br /&gt;			End If&lt;br /&gt;&lt;br /&gt;			' A field change has occurred and the DOM is writable. Write code here to &lt;br /&gt;respond&lt;br /&gt;         ' to the changes.&lt;br /&gt;         'If FacilityID changes, LocationOffloadCode should be changed to &lt;br /&gt;Null, so sproc can reassign correct code&lt;br /&gt;         Dim myLocationOffloadCode As IXMLDOMNode&lt;br /&gt;&lt;br /&gt;         If e.Operation = "Insert" Then&lt;br /&gt;            Try&lt;br /&gt;               myLocationOffloadCode = &lt;br /&gt;thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Offload_Request/@LocationOffloadCode")&lt;br /&gt;               myLocationOffloadCode.text = Nothing&lt;br /&gt;            Catch ex As Exception&lt;br /&gt;               MsgBox(ex.ToString)&lt;br /&gt;            End Try&lt;br /&gt;         End If&lt;br /&gt;      End Sub&lt;br /&gt;</description></item></channel></rss>