Results 1 to 3 of 3
  1. #1
    dumbledown is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    46

    Smile Run query multiple times on different tables

    Hi,

    I have several tables (table_1, table_2......, table_n); I know value n - but this will change from use to use.
    I have a query that will produce an output from these tables.

    Does anyone know how I can code or refer to the same query so:

    table_1 ------QueryA-------output_1
    table_2 ------QueryA-------output_2
    .
    .


    table_n ------QueryA-------output_n

    Many thanks
    Hugh

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You can do this using VBA - but not really using the 'same' query since each one refers to a different table.
    Do all the tables have the same fields?
    You'd have to pass the VBA Function the value of 'n', and then Loop through each Table number and output number and increment the number at the end of the Loop.

  3. #3
    dumbledown is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    46
    Sorry for the slow reply. Thanks, yes I've done what you said, converting the SQL to VBA. It works great.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2012, 09:17 AM
  2. parameter prompting multiple times
    By sandyg in forum Access
    Replies: 1
    Last Post: 08-15-2011, 10:10 AM
  3. Form_Current() running multiple times
    By caddcop in forum Forms
    Replies: 0
    Last Post: 04-01-2011, 09:00 AM
  4. Replies: 1
    Last Post: 07-12-2010, 12:00 PM
  5. Replies: 5
    Last Post: 12-10-2009, 10:33 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