Populating a List box with folder names

  • Thread starter Thread starter Anne
  • Start date Start date
A

Anne

Hi,
I am using an adp 2003 front end with an sql 2000 back end.
I need to populate a list box with folder names, I know how to do it
with file names, but cannot find a way to do it with Folder names.

Thank you in advance for your help

Anne
 
Hi hope it works!


Dim MyPath As String
Dim MyName As String
Me!Elenco.RowSource = ""
MyPath = "c:\myfolder\"
'MyName = Dir(MyPath)

MyName = Dir(MyPath, vbDIrectory)

Do While MyName <> ""
Me!Elenco.RowSource = _
Me!Elenco.RowSource & MyName & ";"
MyName = Dir
Loop
Me!Elenco.RowSource = _
Left(Me!Elenco.RowSource, _
Len(Me!Elenco.RowSource) - 1)
 
Back
Top