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

  • Follow


Is it possible to obtain a list of all files in one sub-directory with Access 
2007 VBA code? 
 
Brad
0
Reply Utf 4/17/2010 10:44:01 PM

"Brad" <Brad@discussions.microsoft.com> wrote in message 
news:833ACDD1-E21F-4CDC-B8A3-5A68CE70B853@microsoft.com...
> 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.


0
Reply Stuart 4/18/2010 2:26:20 AM


Stuart,

Thanks for the help, I really appreciate it.
 
Brad



"Stuart McCall" wrote:

> "Brad" <Brad@discussions.microsoft.com> wrote in message 
> news:833ACDD1-E21F-4CDC-B8A3-5A68CE70B853@microsoft.com...
> > 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.
> 
> 
> .
> 
0
Reply Utf 4/18/2010 12:15:01 PM

2 Replies
3241 Views

(page loaded in 0.082 seconds)

6/3/2014 12:06:50 AM


Reply: