file list on a form

  • Thread starter Thread starter Matt Bowes
  • Start date Start date
M

Matt Bowes

Hi there

I am trying to show a list of word documents on a form. The document file
names will need to be filtered to respond to specific criteria (the names
all contain a specific quote no) so that only documents relating to a
particular customer will show.

Can anyone help. I think i will need to use the DIR() function to get the
file list but i cant find a way of actually showing the results on a form

Thanks in advance

Matt
 
Hi Matt

Assuming all the DOC files are in the same folder, you can use Dir as
follows:

Dim sFile as String, sList as string
sFile = Dir( YourPath & "\*" & QuoteNumber & "*.doc" )
Do until sFile = vbNullString
sList = sList & sFile & ";"
sFile = Dir()
Loop
 
Back
Top