Results 1 to 2 of 2
  1. #1
    topp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    12

    Defects and departments table question

    Hello all,

    I feel like it has just been a long day but cant seem to figure out how to solve what I believe to be a simple issue. I have a department table and defect code table, with the defects belonging in "certain" departments. I had created a FK to put the department in and then realized that some defects appear in multiple departments. I created these tables so that the combo boxes on my form would show the appropriate defects after the user selected what department they were working in. After setting it up I have run into the issue of having duplicate defect codes in order to get it to show up when it belongs to multiple departments. Any help would be greatly appreciated.
    Here are the two tables I created:
    [Department]
    [PK]DeptID
    Department
    [Defect Codes]
    [PK]DefectID


    Defect Desc
    [FK]DeptID

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    It depends on what defects are but will assume here that they are static defined things since you called them codes. Then 2 primary tables - tblDepts and tblDefects, each not allowing duplicates of department or defect. You also need a junction table. Picture tblDepts on one side and tblDefects on the other with tblDeptDefects in between. This one is a many-to-many table; i.e. the same department can appear many times and the same defect can appear manytimes. Whether or not a combination can appear more than once is determined by your needs.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-17-2017, 09:26 AM
  2. Replies: 1
    Last Post: 09-01-2013, 09:44 PM
  3. Replies: 10
    Last Post: 03-02-2012, 11:06 AM
  4. Count number of defects per category
    By HeadGasket in forum Queries
    Replies: 5
    Last Post: 02-10-2012, 04:13 PM
  5. Merging/linking two legacy tables from different departments
    By jhollingsh615 in forum Database Design
    Replies: 14
    Last Post: 04-07-2011, 11:06 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