I created a form and added some VBScript code to it. After having
difficulties with the code I deleted all of it. Now I am adding code back to
the form but cannot reference any of the fields in it, apparently because it
does not recognize the namespace declaration.
The error I receive is:
>>> A run-time error has occurred...
>>> Object required: 'XDocument.DOM.selectSingleNode(...)'
No, the form does not query the URL in the namespace definition. The
definition can be anything. URLs are often used because that URL offers more
information on the schema.
The namespace definition must match exactly. "XYZ" does not match "ABC", nor
does "2008-03-03T19:03:56" match "2008-03-01T05:23:54" The entire string, as
a whole, within the quotes constitutes the definition of that namespace. If
you substitute in another one then you have a different namespace. This is
no different than human names. My name is Greg Collins. There are other
people named Greg Collins in this world. So when you use the name Greg
Collins -- who are you referring to? When you use the namespace "my", what
are you referring to? The definition helps to keep all that straight.
If you have lost the definition, extract your form files and get a copy of
it from the manifest.xsf, template.xml, view1.xml, or myschema.xsd.

Signature
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com
waffle93 - 04 Mar 2008 19:12 GMT
Thank you Greg. I also noticed that if I click on any of the fields from my
Data Source and then click on the tab 'Advanced' that there is a namespace
definition there. I copied that to my code and it works.
Thanks for the explanation, that makes sense. As a footnote it appears the
namespace definition is created using the date/time the form was created.
-ken
> No, the form does not query the URL in the namespace definition. The
> definition can be anything. URLs are often used because that URL offers more
[quoted text clipped - 11 lines]
> If you have lost the definition, extract your form files and get a copy of
> it from the manifest.xsf, template.xml, view1.xml, or myschema.xsd.
Greg Collins - 04 Mar 2008 22:50 GMT
That is correct. The date/time of the form creation is indeed used in the
namespace definition. It's a means to help ensure (as much as possible) that
the definition is unique, while still being more useful than a GUID.

Signature
Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com