Results 1 to 5 of 5
  1. #1
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40

    Combining 1:1 Relationship Tables in a Query

    Hi All,

    I have a long survey that will be passed to a database. To Normalize it I have broken the sections as separate tables. So, for the initial table I have "CustomerID" as the Primary Key and corresponding "CustomerID" fields in the other 16 tables as 1:1 Relationships. At first the other tables had CustomerID as the Primary Key, but I had to remove them as that didn't work when entering the data. So I still have the 1:1 relationships but only the initial table has a Primary Key, which makes sense.

    Now I want to combine all the information, but I am stuck. In my mind, I'm thinking that I want the Customer ID in the initial Table automatically passed on to the rest of the tables, but I don't think that's how you're suppose to do it as far as Querying is concerned.



    So my question is how do I successfully combine all the information under the same CustomerID while only entering the CustomerID once?

    Any help would be greatly appreciated. Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Need an ID field in the related tables to serve as foreign key. This foreign key can be the CustomerID. I hope you still have the CustomerID field in the related tables.

    Use form/subform arrangement for entering new records. The subform container Master/Child links properties will synchronize record and automatically save the primary key of main form as foreign key in subform.
    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.

  3. #3
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    I see...so it's through the Forms, not Querying that you link them all together? Just curious, would this be the only way to do it?

    And yes, I still have the CustomerID field in the other related tables (although if I didn't, I would just add them).

    I will test this out shortly and confirm. Thanks so much for your prompt response.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The forms are for data entry. The form/subform facilitates saving the primary/foreign keys. This will then allow the related tables to be joined in queries for other purposes, such as building a report for data 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.

  5. #5
    Sa'El is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    40
    Okay, cool. I got the logic together now, and I successfully implemented the solution, so thanks again June for your help.

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

Similar Threads

  1. Combining Two Tables into One
    By kvn5x4 in forum Import/Export Data
    Replies: 5
    Last Post: 05-14-2014, 11:23 AM
  2. Replies: 5
    Last Post: 11-26-2013, 11:11 PM
  3. Replies: 1
    Last Post: 10-21-2012, 11:31 PM
  4. Replies: 5
    Last Post: 10-04-2011, 12:53 PM
  5. Combining Tables by Query
    By jlclark4 in forum Queries
    Replies: 9
    Last Post: 01-25-2011, 12:19 PM

Tags for this Thread

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