Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Unanswered: Filesearch.application

    I am updating a database that was switched from 2000 to 2007 and i need help with getting the right path file. Here is the code:

    If Nz(Me.tblCIFIStatus_subform.Form![Primary Req]) <> 0 Then
    Set fs = Application.FileSearch
    With fs
    .LookIn = "\\Orl40038\shared\SYSMP\Job Description"
    .fileName = Me.tblCIFIStatus_subform.Form![Primary Req] & "*.*"
    .Execute msoSortByFileName
    Reqfound = .FoundFiles(1)
    End With
    End If

    Thanks for the help in advance!

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    What is the problem with the code? Is it returning the wrong result? What is the right result? What are you trying to do, what is it doing, and why is there a disjunction between the two?
    Last edited by nckdryr; 02-02-09 at 16:47.
    Me.Geek = True

  3. #3
    Join Date
    Feb 2009
    Posts
    3
    The problem with the code is that filesearch is not an appropriate function call anymore and i need a way to call the directory to get the single file and not do it recursively as most posts about application.filesearch are. So what i am asking for is if there is a way for me to look in the directory with a parameter as this case is primaryreq and search for that file in the directory.

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    After a quick google search I found this thread, this thread, and this Microsoft article. I think one of those should be able to answer your question. Else post why they won't work or how else you need help.
    Me.Geek = True

  5. #5
    Join Date
    Feb 2009
    Posts
    3
    Thanks so much. It helped a lot!

Posting Permissions

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