Iterating thru ALL subfolders

aziz rasul

Active member
Local time
Today, 00:00
Joined
Jun 26, 2000
Messages
1,935
Does anyone have any code (possibly using FileSystemObject) that allows me to obtain a list of all .mdb files underneath a chosen root directory? The code should be able to go through ALL subfolders i.e. subfolders within subfolders within subfolders etc.

I can then transfer the .mdb files in a table using a recordset.

Root Folder - C:\???.mdb
Sub Folder - C:\SubFolder1\???.mdb
Sub Folder - C:\SubFolder1\???.mdb
Sub Folder - C:\SubFolder1\SubFolder2\???.mdb

etc.
 
Last edited:
Search the Access VBA help files [or this forum] for the FileSearch Object method. Do not forget to use the .SearchSubFolders = True property.
 
Or the Object Browser, From the IDE window.
In libraries, select "Scripting".
Don't forget to create a reference to the,
"Microsoft Scripting RunTime" library.

From there, you will probably also see, ghudson's suggestion.
 

Users who are viewing this thread

Back
Top Bottom