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



    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..

    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
                AttachST = 0
                Exit Sub
            End If
        End With
        Exit Sub
        MsgBox "File Path Not Found (" & Error$ & ")", vbInformation, vbNullString
        Resume Search_Exit
    End Sub
    Thank you ever so much

  2. #2
    Join Date
    May 2005
    Sterling Heights, MI

    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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.