File Search Dialog Box

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

Guest

I have an application where I am using a form to prompt a user for a file
path and name. I would like my appliation to be able to invoke the standard
Windows file search dialog box. Is there anyway to do this in Access or with
VB code?

Thanks
Tom Ferazzi
(e-mail address removed)
 
I am using Access 2003. Under file dialog property, here's what it says:

FileDialog Property
See AlsoApplies ToExampleSpecificsReturns a FileDialog object which
represents a single instance of a file dialog box.

expression.FileDialog(dialogType)
expression Required. An expression that returns one of the objects in the
Applies To list.

dialogType Required MsoFileDialogType. The type of file dialog box.

MsoFileDialogType can be one of these MsoFileDialogType constants.
msoFileDialogFilePicker
msoFileDialogFolderPicker
msoFileDialogOpen
msoFileDialogSaveAs

Example
This example displays the Save As dialog box.

Dim dlgSaveAs As FileDialog

Set dlgSaveAs = Application.FileDialog( _
FileDialogType:=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( _
FileDialogType:=msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = True
.Show
End With


I copied and pasted this into my VB code in access and it didn't work. I
copied and pasted it into a macro in Microsoft word and it worked perfectly...

Any ideas?

P.S. I really tried to follow that code you linked, but it is just so long
and confusing...
 
Nevermind... It was just a matter of dimensioning dlgOpen as a public
variable...
 
You probably need to set a reference to the Microsoft Office Object Library.
Open your code window and go to Tools >>> References, then find and check
the Microsoft Office Object Library for your version (that would be version
11 for Office 2003)
 

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

Back
Top