Populate List Box with Files from a specific directory

  • Thread starter Thread starter Norma
  • Start date Start date
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
 
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
 
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
 
Back
Top