Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't open filedialog from access

Status
Not open for further replies.

Jason760

Technical User
Mar 28, 2002
5
US
I'm am trying to open the filedialog box, I copied the code straight from the help file, but I get an error saying Filedialog is a user-defined function which is not defined.I am using Access 2002 and any help or explanation why this won't work would be greatly appreciated.


Dim dlgSaveAs As FileDialog

Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

dlgSaveAs.Show
'This example displays the Open dialog box and allows a user to select multiple files to open.

Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog(msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = True
.Show
End With



End Sub
 
When you copied this Function did you save it to a database module. It seems that ACCESS cannot find this function.(FileDialog())

You are making a call to the function but it is not saved in a module as expected.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Dim them as variants (remove As FileDialog Also, using the mso constants may fail, so try numbers:

Dim dlgSaveAs
Dim dlgOpen
Set dlgSaveAs = Application.FileDialog(1)
dlgSaveAs.Show


A (much) better alternative for the OpenSaveDialog:



Good luck


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top