You entered an expression that has an invalid reference to the property FileSearch

M

M Skabialka

Many years ago I downloaded a sample database written by Arvin Meyer that
was a Document Manager. I modified it quite a bit, adding keywords so
people could narrow their searches for files, but left the original code
where it searches for all files in a selected folder and sub-folders as it
was. There was also a feature to look for files that had been deleted. I
upgraded it from older versions through Office 2003, then tried to run it
today in Access 2007 and the function looking for deleted files errored out
saying:
You entered an expression that has an invalid reference to the property
FileSearch.
The code seems to get stuck on
Set fs = Application.FileSearch

and is used for this:
If Len(Dir(rs!FilePath & rs!FileName)) = 0 Then ' the file
isn't there
rs.Edit
rs!FileMoved = True
rs.Update
End If

It seems that Access 2007 no longer supports Application.FileSearch.
What is the work-around, or new code to do this?
Thanks,
Mich
 
J

Jeanette Cunningham

Mich,
find out about File Search for A2007 by typing the word FileSearch in the
immediate window and pressing F1.
Do the same for Application.
Hopefully that will give any new information about how to use those methods
in A2007.
If no joy with this approach, download a new copy of Arvin's sample and use
the common File/Open/Save api as used in Arvin's code.


Jeanette Cunningham
 
M

M Skabialka

As it turns out the code was unused in the module, and now I am not even
sure it was from his original database as I had modified it a lot..
Set fs = Application.FileSearch
was in the code, but fs never used. I deleted it and the rest of the code
worked fine. I wasn't able to find the new copy of the sample database on
Arvin's site - looking in the wrong place probably...!
Thanks - Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top