Results 1 to 4 of 4
  1. #1
    Ruth Liew is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    4

    How to combine multiple tables (all are with unique ID names) into one table?


    I have create 6 tables for library books (which are differentiated by categories). Each table has different category and unique ID name e.g. F1, F2, F3..(for table 1), G1, G2, G3..(for table 2) and so on. How do I combine all those tables into 1 table for easy search for a book rather than open up each table? Tried append query but its ID run as 1, 2, 3... , not F1, F2, F3 and it only append 1 table, not the rest. Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The data should all be in one table, with a field for category in my opinion. If you want to keep it like it is, you can use a UNION query to pull them all together.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Unless the categories have vastly different information requirements, Paul is right, that should be one table with a field to indicate which category of book is involved. If there is a significant difference (lots of distinct fields required) for some categories of books, the differences (only) can be stored in a second table. If there are two distinct sets of data, for instance nonfiction and fiction books having vastly different information, then it's your choice whether to have three tables (one for all books fields, one for fiction supplemental fields, one for nonfiction supplemental fields). or to have two tables (one for fiction, one for nonfiction).

    If you want to merge the tables, you can build a query that will append each of the six tables onto a seventh table. For each one, have an OLDID field, type text, to hold the old F1, F2 etc, a category field, and an autokey field to give each record a unique key. The process will take some time, and should be repeated in a test copy of the database until you have all the steps working to make the change.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I concur that one table would be best.

    But if you must maintain separate tables, use a UNION query to combine into a single dataset for report output.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-12-2013, 03:03 PM
  2. How do I combine 3 tables into one?
    By Steven Seagal in forum Access
    Replies: 3
    Last Post: 09-18-2012, 06:54 AM
  3. Importing XML with XSLT to multiple tables without unique key
    By ObstructedBelt in forum Import/Export Data
    Replies: 3
    Last Post: 06-27-2012, 01:21 PM
  4. Replies: 4
    Last Post: 10-28-2011, 12:49 PM
  5. Replies: 7
    Last Post: 08-18-2011, 02:18 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