J
JC
Hi,
I am trying the following in VBScript:
MsgBox XDocument.DOM.selectSingleNode("//my:field1").text
But I get an "Object Required: " error on that line. AFAIK I have the
namespace declared properly... and I do have a "field1" field in my data
source.
Something else I tried, was to right-click the textbox, go to Properties >
Data Validation > Events: OnBeforeChange > Edit, at which point InfoPath
switched to the script editor and inserted the following comment... Note the
3rd line:
'=======
' The following function handler is created by Microsoft Office InfoPath.
' Do not modify the name of the function, or the name and number of
arguments.
' This function is associated with the following field or group (XPath):
/my:myFields/my:field1
' Note: Information in this comment is not updated after the function
handler is created.
'=======
So I edited the line of code to read instead:
MsgBox XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text
However I receive the exact same error. What am I doing wrong?
Thanks in advance,
JC
I am trying the following in VBScript:
MsgBox XDocument.DOM.selectSingleNode("//my:field1").text
But I get an "Object Required: " error on that line. AFAIK I have the
namespace declared properly... and I do have a "field1" field in my data
source.
Something else I tried, was to right-click the textbox, go to Properties >
Data Validation > Events: OnBeforeChange > Edit, at which point InfoPath
switched to the script editor and inserted the following comment... Note the
3rd line:
'=======
' The following function handler is created by Microsoft Office InfoPath.
' Do not modify the name of the function, or the name and number of
arguments.
' This function is associated with the following field or group (XPath):
/my:myFields/my:field1
' Note: Information in this comment is not updated after the function
handler is created.
'=======
So I edited the line of code to read instead:
MsgBox XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text
However I receive the exact same error. What am I doing wrong?
Thanks in advance,
JC