File path button

Keith

Registered User.
Local time
Today, 02:42
Joined
May 21, 2000
Messages
129
I am trying to code a button to select a file path.
I get a compile error: User-defined type not defined on the following line;

Code:
Dim [COLOR="green"]fldg As FileDialog[/COLOR]
 
You need a reference to the Microsoft Office X.0 Object Library
 
Sorry I should have mentioned I am using Access 2010 and the Access 14.0 Object Library is ticked
 
I actually said Microsoft Office not Microsoft Access.
 
Sorry, off to specksavers in the morning. Thank you.
 
If you have the right library, this code is enough....

With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
strPath = .SelectedItems(1)
End If
End With
 
I am trying to code a button to select a file path.
I get a compile error: User-defined type not defined on the following line;...
@Jack, if you read the entire thread you'll find that the problem (highlighted in red) has already been identified and solved. It has nothing to do with code implementation.
 

Users who are viewing this thread

Back
Top Bottom