Results 1 to 5 of 5
  1. #1
    sshivji is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    3

    Queries with Linked Tables

    Hello, here is my issue. I have a FE with linked tables to several BE. Each BE has 2 tables (lets say A and B) and every year I add a BE and link the table with FE.


    The 2 unrelated tables in each BE would be named e.g., A2015, B2015, A2016, B2016, etc.

    In the FE I have report menu whereby the user would query the Case # and the query would give the info. Is there a way to create a query.

    Also, for the current year I would add A2017 and B2017. How would I create a "dynamic" query such that this query would search ALL BE.

    Thanks in advance.

  2. #2
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    If I understand your post; you data structure is not suitable for a relational database. One parameter cannot be queried across multiple tables in the way you describe, and as you add back end tables....

    Instead of adding tables - you need to append the data into a common table, while adding a value into an ID field that tells you the source of the data...so that as the records intermingle you will always know the source of each record.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,839
    An alternative would be to use a union query for each year, but if the tables are so large they need to be in separate back ends it is likely to be very slow. Something like


    SELECT *
    FROM A2015
    WHERE CaseNo=123
    UNION ALL
    SELECT *
    FROM A2016
    WHERE CaseNo=123
    etc

  4. #4
    sshivji is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    3
    Thank NTC. I will try the "common table" way.

  5. #5
    sshivji is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    3
    Thanks Ajax.

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

Similar Threads

  1. Replies: 6
    Last Post: 11-10-2014, 03:25 PM
  2. Queries and relationships with Linked Tables
    By stardust1979 in forum Queries
    Replies: 3
    Last Post: 08-04-2014, 09:53 AM
  3. Replies: 11
    Last Post: 07-22-2014, 02:13 PM
  4. Replies: 4
    Last Post: 11-22-2013, 11:20 AM
  5. Replies: 5
    Last Post: 02-02-2012, 06:42 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