Populate List Box with Files from a specific directory

N

Norma

I am using Access 97 and Windows 2000. I am trying to set
up a list box and the populate it with the report files
from my Crystal Reports Directory. I am knowledgeable in
Access and Visual Basic. Any help I can get to get
started will be appreciated.

Thanks

Norma
 
B

Bruce M. Thompson

I am using Access 97 and Windows 2000. I am trying to set
up a list box and the populate it with the report files
from my Crystal Reports Directory. I am knowledgeable in
Access and Visual Basic. Any help I can get to get
started will be appreciated.

See if the following will give you what you want:

Use Class modules to return Dir and File names
http://www.mvps.org/access/modules/mdl0013.htm
 
C

Chris

Dir() funciton would work

Dim strFiles as String
Dim strDirectory as String
Dim strFile as String
strDirectory = "C:\Path\"
strFile = Dir(strDirectory & "*.rpt")
Do Until strFile = ""
strFiles = strFiles & strFile & ";"
strFile = Dir
Loop

cboBox.RowSource = strFiles


Chris
 

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