O
Oliver Friedrich
Hallo,
I have a form where I want to insert a path into a string control
"resourceDescriptor". When I click the button "CTRL13_7" I want to open a
fileDialog where I can select the file and then write that value to the
control.
When I open the form this works only once. After "insert new record" it
doesn't copy anymore. There are no errors or warnings popping up, neither
in InfoPath nor in VisualStudio. Can anybody help me resolve this
problem?
Here's my code:
Public Sub CTRL13_7_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)
Dim nav As System.Xml.XPath.XPathNavigator
nav = Me.MainDataSource.CreateNavigator
Dim path As String
Dim fileDialog As OpenFileDialog
fileDialog = New OpenFileDialog
fileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)
|*.*"
If (fileDialog.ShowDialog = DialogResult.OK) Then
path = fileDialog.FileName
nav.SelectSingleNode
("/dfs:myFields/dfs:dataFields/d:Test/@resourceDescriptor",
Me.NamespaceManager).SetValue(path)
End If
End Sub
Greetings
Oli
I have a form where I want to insert a path into a string control
"resourceDescriptor". When I click the button "CTRL13_7" I want to open a
fileDialog where I can select the file and then write that value to the
control.
When I open the form this works only once. After "insert new record" it
doesn't copy anymore. There are no errors or warnings popping up, neither
in InfoPath nor in VisualStudio. Can anybody help me resolve this
problem?
Here's my code:
Public Sub CTRL13_7_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)
Dim nav As System.Xml.XPath.XPathNavigator
nav = Me.MainDataSource.CreateNavigator
Dim path As String
Dim fileDialog As OpenFileDialog
fileDialog = New OpenFileDialog
fileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)
|*.*"
If (fileDialog.ShowDialog = DialogResult.OK) Then
path = fileDialog.FileName
nav.SelectSingleNode
("/dfs:myFields/dfs:dataFields/d:Test/@resourceDescriptor",
Me.NamespaceManager).SetValue(path)
End If
End Sub
Greetings
Oli