CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    192

    Application.FileSearch

    Hi,

    I am working with Microsoft Access 2010. I have an application which was developed in Access 2003 and is using the Application.FileSearch command.

    This command is not present in Access2010 please could anyone check and update the code to cater for the FileSearch..

    Code:
    Sub Search2()
    On Error GoTo Search_Err
    
        Dim strPrompt As String, strTitle As String
        
        
        ChDir AttachmentPath   ' Changes directory to new file path
                           
        Dim i As Integer
        With Application.FileSearch
            .LookIn = AttachmentPath
            .FileName = Fname
            If .Execute > 0 Then
                AttachST = 1
            Else
                AttachST = 0
                Exit Sub
            End If
        End With
    
    Search_Exit:
        Exit Sub
    
    Search_Err:
        MsgBox "File Path Not Found (" & Error$ & ")", vbInformation, vbNullString
        Resume Search_Exit
    
    End Sub
    Thank you ever so much

  2. #2
    Join Date
    May 2005
    Location
    Sterling Heights, MI
    Posts
    74

    Re: Application.FileSearch

    Application.FileSearch was removed starting with Access 2007 and was not replaced with any built in functions. The only way to accomplish this recursive type of search is through code.

    http://allenbrowne.com/ser-59.html provides a good example. In addition, the tried and true FilesystemObject can be used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured