• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 788
  • Last Modified:

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.
0
Oolongtea
Asked:
Oolongtea
  • 4
  • 4
  • 2
1 Solution
 
stevbeCommented:
here is  a link to complete code.

www.mvps.org/access/api/api0002.htm

Steve
0
 
dannywarehamCommented:
Steve's link shoud do all you need (I was gonna post the same link!)

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..

:-)
0
 
OolongteaAuthor Commented:
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?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
OolongteaAuthor Commented:
FODLER = FOLDER my apologies I am butterfingers
0
 
stevbeCommented:
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
0
 
dannywarehamCommented:
I believe that the windows dialog does allow you to add a folder if you right-click in the dialog....
0
 
stevbeCommented:
< 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
0
 
OolongteaAuthor Commented:
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.
0
 
OolongteaAuthor Commented:
<<Steves will work for deleting a folder>>
correction make that "deleting" = "selecting"
0
 
stevbeCommented:
<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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now