I am trying to get a field from a datasource linked to a combobox into a text field..but having a maddening time
The datasource is: tblDiagcode
Field 1: strDiagcode
Field 2: strDiagDescr
1. The cboBox is bound to field = strICDMcode ; xpath = /my:myFields/my:Exam/my:grpICDM/my:grpICDMCodes/my:cboICDMCode
2. the text field is xpath = /my:myFields/my:Exam/my:grpICDM/my:grpICDMCodes/my:fldICDM_Text
The code should fire after the 'changed' event in the combobox:
Dim ICDMdata
As XPathNavigator =
Me.DataSources("tblDiagCode").CreateNavigator
'create an xpnavigator object positioned onthe current site; which is the cboICDMcod
Dim ICDMcode
As XPathNavigator = e.Site.CreateNavigator
'lookup the value of the ICDM description in tblDiagCode where cboICDMCode = [tblDiagCode].[strDiagcode]
Dim ICDMdescr As String = ICDMdata.SelectSingleNode("/ICDMdata[strDiagCode ='" _
& e.NewValue & "']/strDiagDescr", Me.NamespaceManager).Value
'''CODE CRASHES in ABove line
'{"Expression must evaluate to a node-set."}
MessageBox.Show(ICDMdescr)
'set the value of ICDMCode_text (which is the second column of the table on the same row as the cbo box) to ICDMDescr
ICDMcode.SelectSingleNode(
"../my:ICDMdescr",
Me.NamespaceManager).SetValue(ICDMdescr.ToString)