Using WildCard (*) with .FileSearch.Filename in Access97 VBA with Windows 2000 
Author Message
 Using WildCard (*) with .FileSearch.Filename in Access97 VBA with Windows 2000

I had a bit of VBA code attached to a form used to search
for files in a corporate file directory related to a
specific record.  All the files are
named "DUSRRRRBlahBlah.xxx" where DUS is the string "DUS",
RRRR is the record number (4 digits), BlahBlah is variable
and xxx is the file extention (mostly .wpd or .doc).

When I used to run this on an Access 97 form in Windows NT
or 95 it worked perfectly.  In Windows 2000 the wild card
causes an error.

The code is

    With Application.FileSearch
        .LookIn = Directory
        .FileName = "DUS" & Record & "*"
        If .Execute(SortBy:=1, SortOrder:=1) > 0 Then
                For i = 1 To .FoundFiles.Count
                       [snip]
                Next i
            Else
                MsgBox "There were no files found."
        End If
    End With

With the & "*" it gives the error "Run-time error '5':
Illegal function call or argument"

Without the & "*" it returns no files.

Does windows 2000 not accept the wildcard?  If not how do
I do a comparable search?  Do I have to pull in the whole
file list and filter it myself?

Thanks,

Eric



Sat, 28 May 2005 03:38:30 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Wildcards and Windows 2000??

2. App in VB5 using Access97 incompatible with machine using Access 2000

3. App in VB5 using Access97 incompatible with machine using Access 2000

4. Search in Outlook 98/2000 using wildcards in VB6

5. Problem using LIKE and wildcards after upgrading to VB6 and Access 2000

6. VBA problems Going from Windows 98 to Windows 2000

7. VBA 6.5, Windows 2000 and Windows API

8. Access97 error on Windows 2000 Professional

9. Compact stmt error access97 in windows 2000

10. Windows 2000 Compatibility Update for Access97

11. Using FileSearch in Access/VBA

12. Need Help Manipulating Excel 2000 from Access 2000 using VBA

 

 
Powered by phpBB® Forum Software