pesky filedialog

  • Thread starter Thread starter jpgarner
  • Start date Start date
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
 
Set dlg = Application.FileDialog(msoFileDialogPicker)

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

msoFileDialogFilePicker
msoFileDialogFolderPicker
msoFileDialogOpen
msoFileDialogSaveAs
 
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
 
Back
Top