Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Reference Error, What reference do I need?

Posted on 2014-03-05
4
442 Views
Last Modified: 2014-03-18
We a moving our Access 2003 applications designed and running on Win/XP to Win7 machines running Access 2010 - 32 bit.  For the most part it's going smoothly but I ran into a reference error in the included routine.  The error:

Error 2455 - You entered an expression that has an invalid reference to property Filesearch.

The error is being thrown on statment
Dim MySearch As Office.FileSearch

This was working fine in Access 2003, Win XP.

I checked the references  on the Win 7 machine and there are no missing or broken references showing.  

What reference am I missing?

Public Sub buildTablesAndTimeStamps()
'
Dim pathAndMDBName As String
Dim MDBName As String
Dim currPath As String
Dim linkedDrive As String
Dim linkedPath As String
'
linkedPath = getLinkedPath
linkedDrive = Mid(linkedPath, 1, 1)
'
currPath = GetProcMDBPath
currPath = linkedDrive & Mid(currPath, 2)
'
ClearTable ("tblCheckTableTimeStamps")
'
    Dim MySearch As Office.FileSearch
    Dim intI As Integer, strList As String, strPath As String
    strPath = currPath   '"C:\"
    Set MySearch = Application.FileSearch
    With MySearch
        .NewSearch    'initialize search (clear old settings)
        .LookIn = strPath   'start point for search
        .FileName = "CI*.MDB"    'file name (takes wildcards)
        .SearchSubFolders = False    'scan folders inside first folder
        .Execute
        
        '.FoundFiles contains the list of filenames found as a collection
        For intI = 1 To .FoundFiles.Count
            pathAndMDBName = .FoundFiles(intI)
            MDBName = Trim(Replace(pathAndMDBName, strPath, ""))
            '
            ' Do not add 'Over' tables since they aren't updated every day anyway
            '
            If InStr(1, MDBName, "over") > 1 Then
            Else
                addAuditTable pathAndMDBName, MDBName
            End If
            'Debug.Print .FoundFiles(intI); "       "; MDBName
        Next intI
    End With
    '
End Sub

Open in new window

0
Comment
Question by:mlcktmguy
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 200 total points
ID: 39906424
It will be named something like:

Microsoft Office XX.X Object Library

where XX.X is something less that 12.0, I don't remember what the # was for Office 2003 of the top of my head.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 39906624
Remember too that the Filesearch object is part of the Office library, not Access, so the machines will need the full version of Office installed on them.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 200 total points
ID: 39906693
Somehow missed that you were migrating to 2010,  that reference should be to:

Microsoft Office 14.0 Object Library
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39937692
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question