Results 1 to 2 of 2
  1. #1
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875

    Recursive Tables!


    I was wondering how I could implement a "tiered" product in my database.

    You see, we sell a product that is assembled from other products (which we also assemble/produce). The rub is that some of these assembled products are themselves, made from other assembled products!

    For example we have Products D and E:
    Product D is made from Products A and B.
    Product E is made from Products A and C.

    Now we have product F:
    Product F is made from Products D and E!

    What we end up (for the assembly components) for Product F is:

    • Product F
      • Product D
        • Product A
        • Product B

      • Product E
        • Product A
        • Product C



    How can I represent that in a database so that there can be an arbitrary number of sub-assemblies (each with an arbitrary number of components)?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    OK, I figured it out. You just add a second field that stores the ID of the "parent" Record (even though the parent's still in the same Table). If there aren't any Parents, you just set this field to zero or something similar.

    Example (and a new, related problem) here!

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

Similar Threads

  1. Replies: 8
    Last Post: 05-25-2010, 04:50 AM
  2. linking tables to other tables
    By detlion1643 in forum Access
    Replies: 1
    Last Post: 01-25-2010, 12:33 PM
  3. Recursive Lookup and display?
    By madyson in forum Access
    Replies: 3
    Last Post: 12-15-2009, 09:01 AM
  4. Joining tables two tables and another table that is not
    By DevintheDude in forum Database Design
    Replies: 0
    Last Post: 09-12-2007, 08:56 AM

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