Results 1 to 5 of 5
  1. #1
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85

    Junction Table?

    I had a table designed to capture SKUs parts.
    SKUID SKUName SKUDescription SKUCategoryIDFK

    Every SKU was required to have a corresponding SKUCategory. For instance, a washer ring may have fallen into the plumbing category.
    But now, management wants the ability to relate a SKU to more than one SKUCategory. So a particular washer ring could for instance fall into the Plumbing and the Aluminum Parts Category.

    Because I thought it was important to have a unique SKUID for each SKU rather than have multiple lines in the SKU table for what is the same SKU although it falls into multiple categories, I created a junction table.
    SKUJunctionCatID SKUIDFK SKUCategoryIDFK


    The junction table sits in between the SKUTable and SKUCategorytable as you suspect linked to the SKUID and SKUCategoryID respectively.

    My forms now of course don't work properly and I have to modify them. For instance, before it was very easy to add a new SKU. Adding a new SKU required adding a SKU name and required adding the SKU category it was associated with. Since the SKU table had both the name and the foreign key for the SKUcategory, creating a form for entry was simple.

    And entering Work Orders were also pretty simple. I have a WorkOrderTable as follows:
    WorkOrderID WorkOrderName WorkOrderDescription DepartmentIDFK



    And it was linked to a WorkOrderSKU table that listed all the parts needed for the workorder including the reasoning for needing that part.

    WorkOrderSKUID WorkOrderIDFK SKUIDFK ReasonCodeIDFK


    So entering in new Work Orders was also fairly simple. Before, the SKUIDFK was associated with a SKUID from the SKU table that always had one, but only one, SKU Category. The WorkOrderSKU table was my subform to my workorder form. Thus, it was very easy to enter a new workorder and then enter the multiple sku parts that were associated with it and the reason why each SKU was needed.

    But now that a SKUID can have multiple categories, I need to be sure that the Work Order identifies which category the SKU is being associated with for this particular order. I am trying to determine the best way to do this.

    The associated categories for the SKUs are now in the junction table, not in the SKU table. Each SKU in the SKU table can have multiple linked records in the junction table. Do I create a query as my subform that connects my workorderSKUtable to my junction table and use that as my subform? I was thinking that I would have a dropdown on the form that had two columns, one showing the SKU and the other showing the SKUCategory it falls in. Therefore, I would just need to choose the correct option depending on what category the SKU falls under for that particular work order. Does this sound right?

    I appreciate your help. My work doesn't allow me to show more. Thank you again.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    I need to be sure that the Work Order identifies which category the SKU is being associated with for this particular order. I am trying to determine the best way to do this.
    Would help to see a screenshot of the form but I suggest store the SKUJunctionCatID rather than the SKUIDFK.

    Presumably you use a combo to select your
    SKUIDFK so modify that to either display the SKUIDFK and SKUCategoryIDFK, or as you suggest choose a category first, then have the rowsource filter for that category. The problem with the latter method is this is called 'cascading combos' and for them to work in a continuous form you would also need to store the SKUCategoryIDFK as well. Or if you know the order is about plumbing, then it could be in an unbound combo on the main form.

  3. #3
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85
    Thank you for your reply. Could you please give me some more insight on your suggestion. I have been trying that but not able to get it to work? Would I leave my table setups the same? Is there anything I need to change? Am I approaching dealing with this issue to begin with the right way by creating the junction table? Thanks.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    difficult to provide more insight without knowing more detail - table design, relationships, example data.

    If you have 1 SKU that can belong to many categories then a junction table is the way to go

  5. #5
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85
    Thank you. I worked on it again and I believe I got it to work now. Appreciate the insight.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-10-2022, 09:40 AM
  2. Replies: 13
    Last Post: 05-10-2017, 12:43 AM
  3. Junction Table Help
    By blkane in forum Database Design
    Replies: 5
    Last Post: 10-19-2014, 11:58 AM
  4. Junction Table
    By troachjr in forum Database Design
    Replies: 1
    Last Post: 03-08-2013, 02:10 AM
  5. Junction Table
    By mae3n in forum Database Design
    Replies: 2
    Last Post: 01-15-2011, 10:23 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