Here is another little VBA nugget that will cycle through and display the contents of a folder. I use this in MS Access for those fun times when I need the application to scan for a particular set of files and load them through the database. In addition to this, I have done some other fairly sweet solutions to display folder contents and to distribute them to an audience or even a custom form that allows users to specify files they need to run actions against.

While all of there are countless reasons to display the contents of a folder in MS Access with VBA, I’ll leave that decision up to you. If you figure out that you do need to do this, then feel free to use this snippet below, or of course download my working file below (just update the filepath). Enjoy!

[download id=”5″ format=”1″]

Display Folder Contents

To implement this snippet, just add it to any module you already have established or create one for itself and call it from any routine in your application. It is fairly flexible in which the only thing you need to establish is after you have pulled the contents of the folder, what you are going to do with the data. Have fun with that, and if you have any questions please feel free to let me know in the comments section below.

Tags: