Application.FileSearch
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Application.FileSearch

  1. #1
    Join Date
    Feb 2009
    Posts
    190

    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.
    Got a question on Linux? Visit our Linux sister site.
    Why Bound Controls Are Evil
    IT professionals freelancer site. Register today to find coders, or offer your services for available freelance projects!
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center