pesky filedialog

J

jpgarner

Hello everyone

I am having trouble with the application.filedialog object... again...

....this time the .filters.add method is not working. I get the unsupported
method or property error message. The code is essentially that given by the
microsoft helpfile. sigh...

any tips would be very much appreciated.

Thanks,

Joe.

p.s. here's the excerpted code:

'*************

Dim dlg As FileDialog

Set dlg = Application.FileDialog(msoFileDialogPicker)

ImportPath = ""

With dlg
.Title = "Select a database to import from"
.InitialFileName = fs.GetParentFolderName(CurrentDb.name)
.Filters.Clear
.Filters.Add "Access Databases", "*.MDB"
If .Show = -1 Then
If .SelectedItems(1) <> "" Then
ImportPath = .SelectedItems(1)
End If
End If
End With
 
W

Wayne Morgan

Set dlg = Application.FileDialog(msoFileDialogPicker)

The help file show possible "mso..." values as

msoFileDialogFilePicker
msoFileDialogFolderPicker
msoFileDialogOpen
msoFileDialogSaveAs
 
J

jpgarner

Thanks Wayne!

Yep, sorry that was a typo in the message, not the code. In fact it wound up
to be Access just being plain weird. Today I opened up the program and it
ran just fine without me making any changes! Sigh.

Thank you anyway.

Best,

Joe
 

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