By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

FileDialog DataType not defined

P: 1
Although I'm relatively new to Access VBA, I've done a lot of macro programming in Excel VBA. The problem I'm having is that I get a 'User Type not defined' error at this line -

Dim fd As FileDialog

I'm currently running Access 2003.
My objective is to select a file in a directory and extract information (mainly path but also some info from the filename) and then make file names based on that selection for importing into Access.

Sub AutoImport()
Dim FileTitle, ErrorMsg, BasePath, SystemName As String
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
.
.
.
End Sub
Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,186
As far as I can see there is no variable type of 'FileDialog' in the main Access libraries.
Is this something you were used to using in Excel?
Nov 14 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
As far as I can see there is no variable type of 'FileDialog' in the main Access libraries.
Is this something you were used to using in Excel?
The FileDialog is only available from Office XP versions and maybe later. Is your version older than this?
Nov 15 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
The FileDialog is only available from Office XP versions and maybe later. Is your version older than this?
BTW, if you do have an office xp or later version you may just need to create a reference to the library.

Go to Tools - References and look for Microsoft Office 10 Library or later version.
Nov 15 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.