Use of FileDialog in Access 2002

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Getting a user defined TYPE error: code was moved from an Access2000 mdb.
Any suggestions for correcting the error.

Private Sub cmdSelectInputFile_Click()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
End Sub

Thanks,
Steve
 
To use the FileDialog object, you need a reference to the MS Office library.

From a code window, choose References from the Tools menu, and check the box
beside:
Microsoft Office xx Library
where "xx" represents your version of Access.

Personally, I won't use that dialog, as it does not work in older versions,
does not work at all for SaveAs (despite the presence of an intellisense
option implying it will), and fails in mde/runtime environment.

It's a bit more code, but much better to use the API call from:
http://www.mvps.org/access/api/api0001.htm
 
Back
Top