.FoundFiles.Count ".Filename" Error

J

john

I'm getting an error in access 97 using the * wildcard in the .FileName, I'm
showing the variations I've tried

Private Sub Command123_Click()
Dim fs As Object
Set fs = Application.FileSearch
With fs
.NewSearch
.Lookin = "C:\Records"
.MatchTextExactly = False

.FileName = "note.txt" 'Works to find files count
.FileName = "*.txt" 'Error: Invalid Procedure Call or Argument
.FileName = "*.*" 'Error: Invalid Procedure Call or Argument
.FileName = "note.*" 'Error: Invalid Procedure Call or Argument

If .Execute(SortOrder:=1) > 0 Then
msgbox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
msgbox "There were no files found."
End If
End With
Set fs = Nothing
End Sub
 
J

john

Just an update I've found this to work, Any Comments as to why?

.FileName = """*"".*"
 
Top