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!

Run/time Error 5 - Invalid procedure, call or argument

Status
Not open for further replies.

ruzi55

Programmer
Jul 6, 2004
8
GB
From within an Access database I am trying to locate error files in an external folder - I have used the following code which comes up with a run-time error 5


'check error log file
Set fs = Application.FileSearch
With fs
.LookIn = "\\NFUR12AP01\MXDATA$\STD\ERROR"
.FileName = "MXSTDIMP*"
*** If .Execute(SortBy:=msoSortbyFileName, _
*** SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With

*** indicate the two lines which are highlighted when error occurs

I am using Access 2000 and have used the help feature to make sure that the code and syntax is correct - I can't see what it is but there is obviously something - please could someone help to throw some light on this?

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top