Problem in searching of a specific file

  • Thread starter Koushik from Tele Atlas
  • Start date
K

Koushik from Tele Atlas

Hi,
Im using Ms Access97 (OS := Win-XP), Im trying to use 'FileSearch' function
in a form to search a specific file in all the network drives.
There is no compilation error but at the run time Im having an error like
this :

Run-Time error '-2144010224 (80350010)' :
Method 'Execute' of object 'FileSearch' failed

The code Im using is :

Private Sub cmdProcess_Click()

Dim strFileName As String, i As Integer
s = Me![txtLookInPath]
strFileName = "xyz.mdb"

If IsNull(Me![txtLookInPath]) Or Me![txtLookInPath].Value = "" Then
MsgBox "No folder selected, select folder....", vbCritical
DoCmd.GoToControl "cmdSelectFolder"
Else
With Application.FileSearch
.FileName = strFileName
.LookIn = s
.SearchSubFolders = True
If .Execute() > 0 Then
For i = 1 To 10 '.FoundFiles.Count
For Each vItem In .FoundFiles
Debug.Print vItem
Me![txtCurrLocation].Value = vItem
' ReadFileData
Next vItem
Next i
Else
MsgBox "File not found in : " & s, vbInformation
End If
End With
End If
End Sub

Could you please help me out to solve this problem. Send me the solved
coding in your return mail at (e-mail address removed) OR
(e-mail address removed).
Thanks 'n' regards.
Koushik Chakraborty.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top