Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Application.FileSearch how to look in more than one folder

Posted on 2006-11-17
2
Medium Priority
?
140 Views
Last Modified: 2008-02-01
Part of my existing code is as follows:

With Application.FileSearch
        .NewSearch
        .FileName = "*.csv"
        .SearchSubFolders = False
        .LookIn = "S:\Folder1\Data
        .Execute

        etc, etc.


Question:    How would I set the above type of code up if I wanted to look in more folders, such as S:\Folder2\Data,
                  S:\Folder3\Data, etc, etc.
                  Do I have to re-code the above for each folder I want to look in?  Or can I list multiple folders on the
                  ".Lookin =" line?

I'm hoping for something like this:

With Application.FileSearch
        .NewSearch
        .FileName = "*.csv"
        .SearchSubFolders = False
        .LookIn = "S:\Folder1\Data, S:\Folder2\Data, S:\Folder3\Data   <----don't know how to code it but want to look
                                                                                                           in multiple folders here.
        .Execute

        etc, etc.




             
 
0
Comment
Question by:dbfromnewjersey
[X]
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
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 17968471

change this

.SearchSubFolders = False

to

.SearchSubFolders = True
0
 

Author Comment

by:dbfromnewjersey
ID: 18030435
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

730 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