[AccessD] How to List Files in a folder and then Select a Specific File using Access 2007 VBA

John Bodin jbodin at sbor.com
Fri Oct 17 17:18:09 CDT 2014


On the run so I'd have to check my code bank, but you could do the following with a couple of list boxes:

Use the DIR command and walk through all the files in the folder, populating a List Box with their names (and a hidden column for the path).

Give the user a second list box and a few buttons that would allow them to copy the file information from the first listbox to the 'selected' second list box.  Another button to remove a selected file from the second list box.

I seem to remember mvps.org having a sample or two of this.  Good luck.

John

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, October 17, 2014 5:53 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] How to List Files in a folder and then Select a Specific File using Access 2007 VBA

All,

I am working on an Access 2007 application which will obtain data from one of multiple Excel files.

I would like to be able to list all of the Excel files in one folder and then obtain the name of the file that is selected by the user.

I have been experimenting with "Application.FileDialog" but keep running into problems.  I have very little experience in this realm. 

Does anyone have an example of how to do this or possibly a link to a good example on the web?

Thanks,

Brad

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list