Results 1 to 6 of 6
  1. #1
    khowailedg is offline Novice
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    3

    One single query resulting in multiple tables, is that possible?

    Hello,



    I appreciate your time and effort. I have 2 tables;

    1. Sponsors table about 50 records
    2. Contractor table about 3000 records. Each contractor has a parent sponsor

    I would like to query specific contractors field for each sponsor I can use the sponsor name as the criteria and run it 50 times but that's time consuming. Do you know of any other way to do this? Pretty much for every unique ID in the sponsors table create a separate table with the selected contractors information.

    THANKS for your help

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    What is your end goal here? What exactly are you intending to do with these 50 tables (or queries)?
    I am not sure I see the advantage to creating 50 tables.

  3. #3
    khowailedg is offline Novice
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    3
    I than would export these 50 tables to excel and send it to individual sponsors to review, edit and complete.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I don't think you would save much by doing that. Either way, you are probably going to need a loop, either to create and populate 50 tables, or a loop to export the query with 50 different criteria.

    I am thinking you could use Recordsets, and loop through your Sponsors table, updating the criteria of your query to match that particular Sponsor, export the data, then continue on to the next one.

  5. #5
    khowailedg is offline Novice
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    3
    Thanks, what is the Recordsets?

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you Google something like "Access programming with DAO Recordsets", you should find lots of information.

    When I get more time, I may be able to work up an example, but I would need to know the structure of your Sponsors table, and what the SQL code of the query you want to export looks like.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form with single record but multiple tables
    By thegooser in forum Forms
    Replies: 1
    Last Post: 10-10-2012, 01:48 PM
  2. Replies: 10
    Last Post: 08-09-2012, 01:07 PM
  3. Replies: 5
    Last Post: 12-04-2011, 10:52 PM
  4. Table related to multiple tables by single ID
    By MrTumnus in forum Access
    Replies: 1
    Last Post: 11-17-2009, 02:05 PM
  5. Replies: 1
    Last Post: 07-07-2009, 01:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums