Oolongtea
asked on
Creating a folder select dialog in Access VBA
I simply need to create a "folder selection dialog" in Access XP (2002). Functionality is more important than looks.
I've tried several approaches but they all seem to mainly use the Application.FileDialog which is if I "get it" is really just calling the common dialog for selecting a "file" not a "folder".
In this case we would like to just select a "home folder" which could be empty and contain no files.
Optionally, it would ideally also provide for the basic ADD FODLER (folder icon with an asterisk on the corner) to create a folder if they wished. This exists on the common dialog file picker dialog already.
I apologize for not offering more points but I am new and this was all they provide at first.
I've tried several approaches but they all seem to mainly use the Application.FileDialog which is if I "get it" is really just calling the common dialog for selecting a "file" not a "folder".
In this case we would like to just select a "home folder" which could be empty and contain no files.
Optionally, it would ideally also provide for the basic ADD FODLER (folder icon with an asterisk on the corner) to create a folder if they wished. This exists on the common dialog file picker dialog already.
I apologize for not offering more points but I am new and this was all they provide at first.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow you people are fast. Any suggestions for adding the ideally "also provide for the basic ADD FODLER (folder icon with an asterisk on the corner) to create a folder" part?
ASKER
FODLER = FOLDER my apologies I am butterfingers
Unfortunately that is not part of the standard Windows Folder Browse :-(
Tell to navigate to the folder, if it is not already there, select the folder above it and then give them a button on your form to "Add" folder and you can use MKDir in your code to create the foldwer for them.
You could use the File Dialiog (which does have New Folder functionality) and tell people to select a Default file in that folder (make a dummy file with a nice name like 'Click Here to Select Folder' they might not realize you are goofing them)
You could use TreeControl and build your own (lots of work)
Steve
Tell to navigate to the folder, if it is not already there, select the folder above it and then give them a button on your form to "Add" folder and you can use MKDir in your code to create the foldwer for them.
You could use the File Dialiog (which does have New Folder functionality) and tell people to select a Default file in that folder (make a dummy file with a nice name like 'Click Here to Select Folder' they might not realize you are goofing them)
You could use TreeControl and build your own (lots of work)
Steve
I believe that the windows dialog does allow you to add a folder if you right-click in the dialog....
< File Dialiog (which does have New Folder functionality) >
seems I already posted that :-)
it is the Folder Browse is the one that does not and Folder browse is what oolongtea is loking for.
Steve
seems I already posted that :-)
it is the Folder Browse is the one that does not and Folder browse is what oolongtea is loking for.
Steve
ASKER
OK lacking a better solution I will probably just go with a dual solution Steves will work for deleting a folder when create new folder is not needed.
I will likely make single click launch that folder selector and doubleclick launch the alternate file dialog where it will allow users to do both (create folders and choose a file instead of a folder).
If I were a user and had to choose I suppose I'd want both dialogs available.
I will likely make single click launch that folder selector and doubleclick launch the alternate file dialog where it will allow users to do both (create folders and choose a file instead of a folder).
If I were a user and had to choose I suppose I'd want both dialogs available.
ASKER
<<Steves will work for deleting a folder>>
correction make that "deleting" = "selecting"
correction make that "deleting" = "selecting"
<If I were a user and had to choose I suppose I'd want both dialogs available.>
so would I but it just is not that easy.
so would I but it just is not that easy.
If you just want to be able to browse folders, consider TreeView ActiveX control too.
However, I think the standard dialog should do it all for you, and doesn't over-complicate things..
:-)