Path Selection from inside a subroutine

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

Guest

I am trying to use the folder picker option of a file dialog to select a path
from inside a subroutine. The Access VB help suggests this...

Set fd = Application.FileDialog(msoFileDialogFolderPicker)

which does not error out, but does not bring up the folder picker and
returns an empty collection.

Any suggesions?
 
Crisp said:
I am trying to use the folder picker option of a file dialog to select a path
from inside a subroutine. The Access VB help suggests this...

Set fd = Application.FileDialog(msoFileDialogFolderPicker)

which does not error out, but does not bring up the folder picker and
returns an empty collection.


Can't explain it because I've always used
http://www.mvps.org/access/api/api0001.htm
to do that kind of thing.
 
Marsh,

This wasn't very helpful since I am not trying select, open, or save a file.
I am trying to pick a folder and return a path as a destination. I intend
on creating subfolders and files below the level they have selected (by
picking a folder). The example you site is interesting, but doesn't contain
enough information to implement a folder picker, as does the Access
documentation. Unfortunately, the Access VB Help example doesn't work. I
was hoping someone would know, or have proper documentation for a folder
picker.
 
P.S.
I was looking at what I have to do down stream, and it would be nice to
return a FileSystemObject, so that I could reference it to create the
necessary subfolders and start to copy files into them. Just thought I would
mention that in case it would change the approach. I noticed another article
on the access web other than the one you mentioned that showed how to return
the path string. Its better than nothing, but would leave a lot of work to
do, unless I were to use MkDir. Advice?
 
Set fd = Application.FileDialog(msoFileDialogFolderPicker)

You have to use fd.Show if you want to show the file dialog.

This is a new feature for Access, and it works the way it worked in VB, not
the way anything in Access ever worked.

(david)
 
For a folder selection:
http://www.mvps.org/access/api/api0002.htm

From my reading of Help for FileDialog, you have to use:
fd.Show = True
to get it to display the picker window.

OTOH, I don't see where either picker approach has anything
to do with using FSO.

Are you sure you want to become dependent on these two
libraries (Office and Scripting)? I'm pretty sure you can
do whatever it is you're after using the API picker, MkDir
and CopyFile without getting involved with these additional
library installation and versioning issues. Nothing like a
broken Reference to give you and/or your users headaches.
 
I am beginning to think you are OH-SO-Right about the headaches of Office and
Scripting! I am taking the API's much more seriously.
Thanks for your help!

Marshall Barton said:
For a folder selection:
http://www.mvps.org/access/api/api0002.htm

From my reading of Help for FileDialog, you have to use:
fd.Show = True
to get it to display the picker window.

OTOH, I don't see where either picker approach has anything
to do with using FSO.

Are you sure you want to become dependent on these two
libraries (Office and Scripting)? I'm pretty sure you can
do whatever it is you're after using the API picker, MkDir
and CopyFile without getting involved with these additional
library installation and versioning issues. Nothing like a
broken Reference to give you and/or your users headaches.
--
Marsh
MVP [MS Access]

This wasn't very helpful since I am not trying select, open, or save a file.
I am trying to pick a folder and return a path as a destination. I intend
on creating subfolders and files below the level they have selected (by
picking a folder). The example you site is interesting, but doesn't contain
enough information to implement a folder picker, as does the Access
documentation. Unfortunately, the Access VB Help example doesn't work. I
was hoping someone would know, or have proper documentation for a folder
picker.
 
I am beginning to think you are oh-so-right about the Office and Scripting
headaches! I am taking the API's much more seriously. Thanks for your help!

Marshall Barton said:
For a folder selection:
http://www.mvps.org/access/api/api0002.htm

From my reading of Help for FileDialog, you have to use:
fd.Show = True
to get it to display the picker window.

OTOH, I don't see where either picker approach has anything
to do with using FSO.

Are you sure you want to become dependent on these two
libraries (Office and Scripting)? I'm pretty sure you can
do whatever it is you're after using the API picker, MkDir
and CopyFile without getting involved with these additional
library installation and versioning issues. Nothing like a
broken Reference to give you and/or your users headaches.
--
Marsh
MVP [MS Access]

This wasn't very helpful since I am not trying select, open, or save a file.
I am trying to pick a folder and return a path as a destination. I intend
on creating subfolders and files below the level they have selected (by
picking a folder). The example you site is interesting, but doesn't contain
enough information to implement a folder picker, as does the Access
documentation. Unfortunately, the Access VB Help example doesn't work. I
was hoping someone would know, or have proper documentation for a folder
picker.
 
Back
Top