Exporting multiple queries at once

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spl1490
    New Member
    • Jul 2010
    • 4

    Exporting multiple queries at once

    Hello,

    I have a list of people that I am looking to export a report to excel about for each of them separately. I have already done this for a set number of people, but I had to create a lot of queries and I need a way to alter my code so that if I add more people, the code will still be the same.

    I have a query that contains all the information I am trying to export and the specific report I want to export can be found by simply filtering for the person's name (which I have another separate query where I have their name and unique ID number). Is there a way to loop through my query with all the information where every time it loops, it filters by a different name? I don't know if this is possible and i've been trying for a while to get this.

    If you have any ideas of how to make this easier it would be much appreciated.

    Thank You
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Can you put the names in an array?
    Array and loops go nicely together

    Comment

    • spl1490
      New Member
      • Jul 2010
      • 4

      #3
      Arrays

      Thanks for the reply.

      I tried using arrays but I am pretty new to using VB and whatever I typed in kept giving me errors. Do you know of any examples that I could follow?

      Comment

      • spl1490
        New Member
        • Jul 2010
        • 4

        #4
        Oh my goodness. Thank you ever so much for that tip. I looked up how to code for arrays real quick, adjusted for my code, ran it and it works. code green, I couldn't have done it without you.

        Comment

        Working...