Help and Support
 

powered byLive Search

Error message when you try to run the FileSearch function in Access 2007: "You entered an expression that has an invalid reference to the property FileSearch"

Article ID:935402
Last Review:April 5, 2007
Revision:1.0

SYMPTOMS

When you try to run the FileSearch function in Microsoft Office Access 2007, you receive the following error message:
You entered an expression that has an invalid reference to the property FileSearch.
This problem occurs if the FileSearch function was created in an earlier version of Access.

Back to the top

CAUSE

The File Search task pane and the FileSearch object have been removed from the 2007 Microsoft Office programs.

Back to the top

RESOLUTION

To programmatically search for a file in Access 2007, you can use either the Dir function or the FileSystemObject class.

For more information about the Dir function, visit the following Microsoft Web site:
http://office.microsoft.com/en-us/access/HA012288241033.aspx (http://office.microsoft.com/en-us/access/HA012288241033.aspx)

The FileSystemObject class was originally created for the Microsoft Visual Basic Scripting Edition. The FileSystemObject class is not included in the Visual Basic for Applications object library. To use the FileSystemObject class, you must select Microsoft Scripting Run-time (Scrrun.dll) in the References dialog box for the project.

For more information about the FileSystemObject class, click the following article numbers to view the articles in the Microsoft Knowledge Base:
186118 (http://support.microsoft.com/kb/186118/) How to use FileSystemObject with Visual Basic
185601 (http://support.microsoft.com/kb/185601/) How to recursively search directories by using FileSystemObject

Back to the top

MORE INFORMATION

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
920229 (http://support.microsoft.com/kb/920229/) Error message when you run a macro to search for a file in an Office 2007 program: "Run-time error 5111"

Back to the top


APPLIES TO
Microsoft Office Access 2007

Back to the top

Keywords: 
kbexpertiseinter kbtshoot kbprb KB935402

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.