Populating Combo Box Values w/ sub folder names

M

Matt

I am looking for code that will populate a combo box with all subfolder names
within a directory. For example, the directory C:\Tool contains 3 subfolders
called NY, CA, and FL. I want my combo box to automatically retrieve the
subfolder names, which populates the combo box values to NY, CA, and FL.
Suggestions??

Thanks,
Matt
 
D

Dale Fye

Matt,

Check out the DIR() function.
1. you will need to set the combo boxes Row Source Type to value list
2. You will need to write some code to loop through your root folder and
idenfity all the folders. In this loop, you will modify the Row Source for
the combo by appending the names of the folders to the list.

As an alternative, you might want to consider using the BrowsFolder API call
discussed at this web site.

http://www.mvps.org/access/api/api0002.htm
 
Top