W
Wayne Wengert
I am having a problem getting OpenFileDialog to work as expected (see code
below). When I execute the code I do not see the Title I set, nor is the
Filter applied. The "Open" dialog comes up, I select the file I want, and
then the dialog comes up again with my selection in the File Name box. When
I click Open - nothing seems to happen - the variables are not set - it is
as if the dialog never occurred?
===========================================
Dim o1 As New OpenFileDialog
With o1
..Filter = "MS Access Database Files (*.MDB) | *.MDB"
..Title = "Select the existing file to Open"
..InitialDirectory = "c:\Program Files\MyApp"
If .ShowDialog = DialogResult.OK Then
ActiveDBFile = .FileName
Me.lblNameOfDBFile.Text = ActiveDBFile
Me.Refresh()
End If
End With
below). When I execute the code I do not see the Title I set, nor is the
Filter applied. The "Open" dialog comes up, I select the file I want, and
then the dialog comes up again with my selection in the File Name box. When
I click Open - nothing seems to happen - the variables are not set - it is
as if the dialog never occurred?
===========================================
Dim o1 As New OpenFileDialog
With o1
..Filter = "MS Access Database Files (*.MDB) | *.MDB"
..Title = "Select the existing file to Open"
..InitialDirectory = "c:\Program Files\MyApp"
If .ShowDialog = DialogResult.OK Then
ActiveDBFile = .FileName
Me.lblNameOfDBFile.Text = ActiveDBFile
Me.Refresh()
End If
End With