I have a filesearch routine that is only returning 775 or the 1138 files out there on my c:\clients directory. Does anyone see anything wrong with this code? I have stripped out the code as much as I can to simplify the code for debugging, but I only get 775 values back.
Private Sub bScan_Click()
' The purpose of this routine is to find all pdf files located on N drive that have the SOxxxx string
' Located in them. SO pdf files are names with a standard of Invxxxx soxxxx.pdf. This routine will attempt
' to match these files up with their so records in the system.
' Written by Scott Huotari 2/11/2004
'Dim fs As Object
Dim i As Long
vDefPath = "N:\clients\" 'This is the default path for the client files
'Set fs = Application.FileSearch
varReturn = SysCmd(acSysCmdSetStatus, "Processing... ")
.LookIn = vDefPath
.SearchSubFolders = True
.FileName = "*SO*.pdf"
'If .Execute(SortBy:=msoSortbyFileName, SortOrder:=msoSortOrderAscending) > 0 Then
If .Execute() > 0 Then
varReturn = SysCmd(acSysCmdSetStatus, "Processing... " & .foundfiles.Count & " files...")
MsgBox "There were " & .foundfiles.Count & " file(s) found."
For i = 1 To .foundfiles.Count
vso = getso(.foundfiles(i))
varReturn = SysCmd(acSysCmdSetStatus, "Processing... " & i & " of " & .foundfiles.Count & " files...")
If (vso <> "") Then
vSQL = "update serviceorder set SOPath = '" & .foundfiles(i) & "' where ID = " & vso
MsgBox "There were no files found in " & vDefPath
varReturn = SysCmd(acSysCmdSetStatus, " ")