Use of FileDialog in Access 2002

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
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top