filesearch does not find text files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access 2000 database that uses the FileSearch command in VBA to
find a file called "verify.txt". It works fine in Access 2000 but not in
Access 2003, which I have just upgraded to. I ran some tests that prove that
Access 2003 recognizes all Office file type(e.g ,xls, ppt, doc,mdb) but does
not recognizes file types outside of Office. Does anyone know if this is a
bug in Access 2003 or is there a setting that needs to be changed somewhere.
P.S. - Sandbox is disabled!
 
Guess I need to update my own post: further testing shows this is a
"behavioral" change (e.g. BUG?) in FileSearch that appeared somewhere between
Access 2000 VBA and Access 2003 VBA. If I search for a specific file, in
this case "verify.txt", FileSearch does not find the file. If I search using
a wildcard such as *.txt, FileSearch finds the file.

Here's my code - any suggestions?
'Make sure we have a control file out there, and if so then return the path
'with the name.
strControlFileName = "VERIFY.txt"
With Application.FileSearch
.LookIn = mstrImportPathOnly
.FileName = strControlFileName
'Arrange file names so that most recent date appears first.
If .Execute(SortBy:=msoSortByFileName,
SortOrder:=msoSortOrderDescending) = 0 Then
MsgBox "The Clearinghouse control file is missing. The Import " & _
" process has been halted.", vbOKOnly + vbCritical
strComments = "Not found"
GetControlFile = False
GoTo ExitProc
Else
'get the name of the most recent file.
strControlFileName = .FoundFiles(1)
GetControlFile = True
End If
End With
 
Back
Top