Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSearch...

Status
Not open for further replies.
May 9, 2000
446
GB
I've got a database that looks for *.xls files in in C;\. It all worked fine but now has stopped working. I've just moved to ms access 2002 is this the problem? My code is:

Cheers in advance...

Private Sub Form_Load()
Dim strfilelist As String
Dim i As Integer
Dim strLocation As String

strLocation = "C:\"
With Application.FileSearch
.lookin = strLocation
.Filename = "*.xls"
.SearchSubFolders = False
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
If Len(strfilelist) > 0 Then
strfilelist = strfilelist + ";"
End If
strfilelist = strfilelist + .FoundFiles(i)
Next i
Me.strfilelist.RowSource = strfilelist
Else
MsgBox "No files found" & vbLf & strLocation
Me.strfilelist.Visible = False
End If
End With

End Sub
 
Your code's working fine, asking the obvious, have you got the Row Source Type set to Value List.
 
Billpower, its started working now! Wierd, anyway its now giving me a numeric overflow, I've checked the fields being imported from the *.xls file against those in the table the data is going into and there the same.... any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top