AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile
I want to use VB in Access to open a text file, so I started with following routine (based on MS VB help): Private Sub read_file_Click() Dim a As FileDialog Set dlgOpen = Application.FileDialog( _ FileDialogType:=msoFileDialogOpen) End Sub However, when I try to use this I get a Compile error: "User defined type not defined" on the Dim statement. How is that possible? 'FileDialog' should be a standard type, is it? Or do I have to include a special Reference for this type? Thanks!! JP
In regards to the FileDialog error you must include Microsoft Office 10.0 Object Library in your references. Just in case While in VBA choose Tools then References Good Luck
Yes, that's it!! Thanks for that. (Still amazing Bill's hackers don't put a simple reference in their help-files to indicate with Library is required for a command). cheers, JP