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
'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