Results 1 to 9 of 9
  1. #1
    Integrate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    12

    Linking mulitple items from a table to one item in another in forms

    I have what should be a really simple database to build.
    In table tbl1PlanHdr is the header item. Many items in tbl2MaintItem will then be allocated to each header. MaintItems items will be allocated to more than one Header.


    I want to set up a form that has the tbl1PlanHdr as the main part of the form and tbl2MaintItem as the subform. Possibly as a datasheet, or continuous form.
    I need the ability to update items in the subform back to the orginal table.
    I have a relationship of one to many from the tbl1PlanHdr to tbl2MaintItem using the primary key in tbl1PlanHdr. But should this be a one to many from tbl2MaintItem to tbl1PlanHdr
    The end result required is to be able to get a data dump of all the tbl1PlanHdr items with the corresponding tbl2MaintItems items.

    I used to be able to do this in my sleep, I'm not sure if it is baby brain or I've been hit in the head or I am just over thinking it but I just can't seem to make it work. Please let me know if I need to provide more information.

  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
    What is the relationship - 1-to-many or many-to-many? The latter requires a 3rd (junction) table.
    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
    Integrate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    12
    It is 1 to many. But a junction table might just be what I was missing. Thanks!
    Happy to hear any other suggestions tho...

  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
    Junction table should not be needed with 1 to many. Example of many to many:

    tblOrders

    tblProducts

    Because Order can have many products and product can be associated with many orders, need a junction table:

    tblOrderDetails
    OrderID
    ProductID
    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
    Integrate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    12
    the client has asked that I limit the tables to four which means no junction table. He has also come back with more information, confirming the one to many relationship.

    I need to be able to create a form that allows the many items from tbl2MaintItem to be matched to one item in tbl1PlanHdr with the ability to change an item in tbl2MaintItem and have it change all instances of that item.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    That doesn't make sense to me. Why would changing a record in tbl2MaintItem change other records? Provide an entity relationship diagram of data scheme. Why 4 table limit? What is this db for?
    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.

  7. #7
    Integrate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    12
    Sorry, maybe I am not being clear.
    the maintenance item is allocated to a plan header. Each plan header has more than one maintenance item and a maintenance item can be matched to more than one header.
    so if a maintenance item is matched to more than one plan header. The client wants the ability to change the maintenance items.
    For this part there are two tables. There is a further two tables that follow on from this but I am just focusing on the first two tables for now.
    I have attached a picture of the relationships as I have them now.
    Click image for larger version. 

Name:	Capture.JPG 
Views:	6 
Size:	44.1 KB 
ID:	19939

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Not seeing a junction table for associating tbl1PlanHdr and tbl2MaintItem records. Something like:

    tblPlanMaint
    ID
    PlanID
    MaintID
    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.

  9. #9
    Integrate is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    12
    Thanks for the help but I think I finally have it sorted. The client wanted to avoid junction tables so have had to make the 1 to many work. Seems to be working ok.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2013, 10:29 PM
  2. Linking forms to table
    By jdvd in forum Forms
    Replies: 1
    Last Post: 12-11-2011, 06:20 PM
  3. Replies: 7
    Last Post: 10-25-2011, 08:32 PM
  4. Linking Table Data on Forms
    By P5C768 in forum Database Design
    Replies: 12
    Last Post: 03-22-2010, 09:42 AM
  5. Replies: 5
    Last Post: 08-06-2009, 11:47 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