Obtain a list of all files in one sub-directory with VBA?

B

Brad

Is it possible to obtain a list of all files in one sub-directory with Access
2007 VBA code?

Brad
 
S

Stuart McCall

Brad said:
Is it possible to obtain a list of all files in one sub-directory with
Access
2007 VBA code?

Brad

Dim fdr As String

fdr = Dir("c:\temp\*.*")
Do While fdr <> ""
debug.Print fdr
fdr = Dir
Loop

This will output all the file names contained in c:\temp to the debug
window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top