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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSearch not working for C: ????

Status
Not open for further replies.

Klopper

MIS
Dec 7, 2000
84
US
Hi

Anyone have any idea why the code belwo works for all my network drives but not if I do a search in the C: hard drive?

With Application.FileSearch
.LookIn = "C:\TEMP"
.FileName = "*.mdb"
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With
 
If I understand your proble correctly, you want to find a file in a sub folder of your hard drive(C:)
The search you did does not check sub folders.
to make it check simply add the following right after .LookIn = "C:\"

.SearchSubFolders = True

Let me know if this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top