I'm using Access 2000 on Windows 7, and have been following numerous examples of how to create a "Browse for file" button which displays the path of the file in a text box.
This is as close as I have come to finding a solution, and yet I have an error with the line highlighted in bold below.
The error states:
Compile Error:
Method or Data Member not found
Can anyone explain what might be causing the problem?
My code is found below:
Many thanks!
This is as close as I have come to finding a solution, and yet I have an error with the line highlighted in bold below.
The error states:
Compile Error:
Method or Data Member not found
Can anyone explain what might be causing the problem?
My code is found below:
Code:
Private Sub fdg_Click()
Dim fdg As FileDialog, vrtSelectedItem As Variant
Dim strSelectedFile As String
[u]Set fdg = Application.FileDialog(msoFileDialogFilePicker)[/u]
With fdg
.AllowMultiSelect = False
.InitialView = msoFileDialogViewDetails
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems 'onby be 1
strSelectedFile = vrtSelectedItem & "#" & vrtSelectedItem
Next vrtSelectedItem
Me![txtSelectedFile] = strSelectedFile
Else 'The user pressed Cancel.
End If
End With
Set fd = Nothing
End Sub
Many thanks!
Comment