Populating a List box with folder names

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
 
C

ciroteo

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)
 

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