RE: .Execute vexing me

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



:)

Nap away; you've earned it.

- Gort


"Klatuu" wrote:

Glad you found it.
Can I go back to my nap now?
:{)

"pvdalen" wrote:

I found the issue. It appears I'm an imbicile. The file wasn't where I was
searching and I was misinterpreting the function itself. For what it's
worth, the .MatchTextExactly worked just fine.

Thanks for your help. Sorry I wasted your time.


"Klatuu" wrote:

I notice you are using .MatchTextExactly = True without setting the
.TextOrProperty property. Without testing, I can't be sure, but that may
cause it to return no files at all, which would make .Execute = 0.
The MatchTextExactly says return only files of .FileType that have the text
specified in .TextOrProperty property in either their body text or their
properties.
Before you change it, set a breakpoint at the .Execute line then step
through it to see where it is going. If it drops to the End If, that means
no files are being returned. If that is the case, try commenting out the
.MatchTextExactly line and running it again.

"pvdalen" wrote:

Hi all,

I copied the following code elsewhere, so I know it must work:

strFiles = ""
With Application.FileSearch
.NewSearch
.LookIn = strDrive
.SearchSubFolders = True
.FileName = strFilename
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For Each varItm In .FoundFiles
strTmp = fGetFileName(varItm)
If strFilename = strTmp Then
fReturnFilePath = varItm
Exit Function
End If
Next varItm
End If

Anyway, my issue is that when the ".Execute" line is encountered, it appears
as if the method isn't even being attempted. The program appears to run for
about 2 seconds, then goes right to the "End If" line associated with the
".Execute" line. It's as if the condition is automatically assigned a False
value before the method is allowed run.

I do have the correct references implemented. Am I missing something simple?

Thanks, as always.
.



Relevant Pages

  • Re: In a report -Using a calculated field in Select Case causes Er
    ... "Klatuu" wrote: ... Dave Hargis, Microsoft Access MVP ... should open on its own and suspend execution of the report. ... The line has not executed, but it will be the next to execute. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to write a nested loop using sql cursors
    ... The real trick in optimizing your code is to NOT execute any sql over and ... over in the loop. ... That means you want to open the table up ONCE, and then do your searching. ... A simple query can match ...
    (microsoft.public.access.forms)
  • Re: Fastest means to extracting data?
    ... Thanks Ron and Klatuu, ... I have tried the .Execute and yes, it is much faster and looks like the fix. ... CurrentDB.Execute "SELECT DestTable.* INTO tblStockData FROM DestTable WHERE ... This takes several minutes and causes issues with other contemporaneous users of the database - users with their own FE connecting to the shared BE (of which the sql table is a part). ...
    (microsoft.public.access.formscoding)
  • Re: Newsgroups error combining messages
    ... avoid the delays with OE searching for hyperlinks. ... ErrMsg The Command Failed to Execute ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: exec code in "globaldict"
    ... > I kept searching my online and offline python ressources to figure out ... > how to execute some code in the global dictionary. ...
    (comp.lang.python)