Click to See Complete Forum and Search --> : Quick VBA question


flyersguy85
06-28-2005, 10:19 AM
OK here is my code so far:

With Application.FileSearch
.LookIn = "C:\Documents and Settings\kqdx564\My Documents\test"
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
Me!List156 = .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With

I wrote this for a previous database that I had been working on and made a few changes since I have been playing with it. I need to do 2 things. 1) Take search criterea out of a text box (Text159) and search for files that have that in it (not exact match) and then I want to display the search results in the list box (List156). Right now I don't have the filename part, but the list box part is inside the for loop and for some reason isn't working. Any help would be greatly appreciated.