Combobox to show filenames in a directory

April15Hater

Accountant
Local time
Yesterday, 23:41
Joined
Sep 12, 2008
Messages
349
Hey guys,
The subject is pretty self explanatory. I have a directory with all Excel Templates and I want them to be listed in a combo box for the end user to select.

I'd imagine that I'd have to write the filenames to a table, and have the combobox query that table, i just don't know how to get those file name values into the table. I've been researching to no avail, and I don't even know where to start with this.

Thanks,

Joe
 
If you want a file with the files listed in a location, you can use the dir command from a command prompt. Make sure you specify the file name you want the output. For example:

dir > c:\Test.txt

Once the file is created, you can go into it, strip out the unnecessary data and import it. Not sure if your file name are going to change...if so, then you might want to find another solution.
 
Hey- Thanks for the reply. Unfortunately in this case, the list is going to be dynamic so I don't think that will work.

Was thinking maybe I could shell that command, make the file, and have it import automatically, but geez, that's a lot for a simple drop-down...
 
Very nice!! That is exactly what I needed. I even learned a new trick while deciphering the append query that writes to tblFoundFiles. Thanks again David, you're a lifesaver!
 

Users who are viewing this thread

Back
Top Bottom