Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004
    Posts
    41

    Unanswered: Application.FileSearch not in Access 2007

    Hello,
    I have recently upgraded to Office 2007 and an inherited database uses the "application.filesearch" method, which is not available in MS Access 2007. Would anyone be willing to offer an alternative method?
    Any help is much appreciated!

    Code:
    Set fs = Application.FileSearch
        With fs
            .LookIn = flName3
            .filename = "*.*"
            
            If .Execute > 0 Then
                MsgBox "There were " & .foundfiles.Count & _
                " file(s) found."
                
            
                For i = 1 To .foundfiles.Count
                    
                    
                    flName = .foundfiles(i)

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I wonder if you don't need a Reference to use it for Access 2007.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    You are correct Reg, this is removed in the 2007 version.

    There was recently a thread where some alternatives were brought up and discussed.

    I mentioned the same there, and also suggested to have a look at the approaches of Allen Browne and Douglas Steele, here are direct links again
    http://allenbrowne.com/ser-59.html
    http://advisor.com/doc/16279

    Edit: the thread http://www.dbforums.com/showthread.php?t=1619287
    Last edited by RoyVidar; 07-30-07 at 05:49. Reason: Forgot the thread...
    Roy-Vidar

  4. #4
    Join Date
    Dec 2004
    Posts
    41
    Apologies for the dup post, but thanks for the leads!

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    See it in an example

    If you want to see some code on how it's done, this example might help you. http://www.dbforums.com/showpost.php...45&postcount=2

    Remember to hold the shift key when getting into it as I use code on the PublicHealth form (main form), to get rid of the MSAccess info. The code uses the method RoyVidar mentioned in the post above.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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