Results 1 to 9 of 9
  1. #1
    dluga20 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    23

    Begginer Relationships Question

    Hello All,



    I am a beginner (and yes I have already watched many online tutorials so please don't point me to any) and I am trying to figure out how to set up some relationships. Can someone show me an ERD and/or explanation of the description below? I can't seem to figure it out despite it seeming so simple.

    I want to build a DB containing part numbers, fixtures, and gauges. Any part number can have any number of fixtures or gauges. For example, part number 123 may have 2 fixtures and 1 gauge associated. Part number 456 may have no fixture and 2 gauges associated with it.

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you need two tables, one for parts and one for fixtures and gauges

    if a fixture or gauge can be in more than one part then you need a third 'link' table

    please clarify and we can move on to what those tables need to look like

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Yes, 2 tables.
    tFixtures would have a code fld, FIX or GUA
    And this table can self relating...with a [parent] ID, if a fixture has sub fixtures.

  4. #4
    dluga20 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    23
    Quote Originally Posted by Ajax View Post
    you need two tables, one for parts and one for fixtures and gauges

    if a fixture or gauge can be in more than one part then you need a third 'link' table

    please clarify and we can move on to what those tables need to look like

    Yes a fixture or gauge can be used for multiple part numbers in some instances.

  5. #5
    dluga20 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    23
    Here are my relationships. I know it is probably not perfect but I am just looking to learn at this point. I think my tables are set up okay, everything is related pretty, and it will give me the functionality I am looking for. Ultimately I am looking to be able to run reports and set up forms based on the part numbers. Can anyone tell me if everything is set up well enough to be able to do this, how to go about making the forms and reports, or if anything needs to be changed in order to do so.
    Click image for larger version. 

Name:	Capture.PNG 
Views:	18 
Size:	24.6 KB 
ID:	20961

  6. #6
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    1. as previously advised, you need one table for fixtures and gauges (tblGuages and tblFixtures) lets call it tblItems. Add to this table another field ItemType to indicate whether it is a fixture or gauge.
    2. you do not need tblFixGua
    3. connect tblFixGuaPN_Link to tblItems on FixGuaID=ID
    4. I notice you appear to be using a multivalue field for Models. Appreciate I do not know what this is for, but use with caution. If your list of models can change then a multivalue field is not the thing to use. Also these fields cannot be indexed so if you need to search or sort on them, this will slow your system down considerably.

  7. #7
    dluga20 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    23
    Okay I think I understand your point. I see one issue, however. If fixtures and gauges were in the same table with an item type field, then I would not be able to duplicate the fixture/gauge numbers field. Our fixtures and gauges are numbered like so: G00123 and F00123. I planned on keeping these fields as an indexed number type field and either format them inside the field or in the form. Any suggestions?

    Also, the models field is an attachment field. It would hold 3d CAD model files for each record.

  8. #8
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    then I would not be able to duplicate the fixture/gauge numbers field.
    Yes you can

    a) you are linking on ID and this is the 'true' identifier
    b) you can use a combination index of itemtype and F/GNumber to make sure you cannot have the same number more than once for the same itemtype - in table design on the ribbon, select indexes


    Point taken about the attachment field but you might want to consider storing these drawing files in a defined folder and then simply store the filename in the db (and in a separate table if more than one drawing per fixture/guage) - will keep the db smaller and more efficient.

    You also asked

    what if fixtures and guages had different fields? Would i need separate tables then at that point?
    It depends. if it is only a few fields, I would say no, if it is 20 or thirty fields then probably. Also depends on how the data is being used - may be easier is separate tables, maybe not. Note that an empty field does not take up any space in the db

  9. #9
    dluga20 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    23
    This is all very helpful information. Thank you for your help!

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

Similar Threads

  1. Relationships Question from a absolute begginer
    By Guido Meng in forum Access
    Replies: 5
    Last Post: 11-19-2012, 12:06 PM
  2. Begginer Questions
    By NoAlarms in forum Access
    Replies: 4
    Last Post: 04-11-2012, 07:58 PM
  3. Relationships Question(s)
    By Exwarrior187 in forum Database Design
    Replies: 9
    Last Post: 02-14-2011, 02:12 PM
  4. Another relationships question
    By canfish in forum Database Design
    Replies: 0
    Last Post: 07-28-2010, 02:23 PM
  5. question about relationships
    By grad2009 in forum Access
    Replies: 3
    Last Post: 02-16-2010, 06:12 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