Results 1 to 2 of 2
  1. #1
    REBBROWN is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    14

    many-to-many relationship advice

    hey all,
    I am really hoping someone can help me out on this one since I have been banging my head against the wall for hours.
    It's a many-to-many relationship problem that I hope can be resolved in the simplest terms.
    I will try and keep from being too long winded here and keep it brief.

    I am trying to develop a database for shipping.
    The user will first select a carrier (Shipper) and that is one table, we'll call it tbl_CARRIER and here are four typical records for a Carrier:

    tbl_CARRIER
    AALV
    ACOA


    APLS
    AROF

    the Carrier table will have name of Carrier like above for one field and a CARRIER_ID which is primary key, so only two fields in that table, so far so good.

    Once a Carrier is selected then they pick a Container Type.
    Here are few, actually all records for Container Type:

    tbl_CONTAIN_SIZE
    40 FT OVER
    40 FT UNDER
    Doubledrop/RGN
    Doubledrop/RGN OOG
    Flatbed/Stepdeck
    Flatbed/Stepdeck OOG

    Same here, an ID autonumber Primary key and name of Container.
    I have a one to many relationship set up here because Carrier AALV for example might have all these containers or only 2 or 3.

    tbl_CARRIER
    carrier_ID Primary Key


    tbl_CONTAIN_SIZE
    contain_ID
    carrier_ID Foreign Key
    CONTAINER

    Here's where it gets tricky.
    There is one additional table, a Mileage table.
    There is a Start Miles and End Miles and then a charge per mile.
    Here is an example of that table.

    START_MILES END_MILES RATE_MILE
    51 75 $3.86
    76 100 $3.21
    101 150 $2.57
    151 200 $2.82

    The miles go on for a lot of records.
    all the way up to like 3000 miles and above

    Here's a normal selection.
    User picks say ACOA from above and then they pick Flatbed/Stepdeck for a Container size.
    Please keep in mind the following;
    There are 6 different types of container sizes and each of them have their own mileage rates like above.
    The way I have it (in my head) is one Shipper (ACOA for example) selects one of many Container sizes (6 to choose from) and that container size will have it's on rate records like above but ACOA will have different rates per mile for a 40 FT OVER Container than APLS will have for the same 40 FT for the same miles.
    does anyone have an idea how to do a many-to-many relationship on all of this?
    Any and ALL help will be very much appreciated!
    Thanks in Advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Maybe include a field in Mileage for the carrierID (or use the carrier acronyms you show as the primary key) and have records for each carrier.

    Then maybe use dependent comboboxes to limit mileage record choices to the selected carrier. Review http://datapigtechnologies.com/flash...combobox2.html
    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.

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

Similar Threads

  1. Advice for a begineer
    By SteveFlash in forum Access
    Replies: 10
    Last Post: 01-08-2013, 08:02 PM
  2. New-and need help as well as advice
    By bjd1020 in forum Access
    Replies: 8
    Last Post: 11-16-2012, 02:25 PM
  3. Need some advice and help
    By winterh in forum Access
    Replies: 9
    Last Post: 04-18-2012, 06:41 AM
  4. Security Advice
    By jpkeller55 in forum Access
    Replies: 6
    Last Post: 02-18-2011, 08:22 AM
  5. Need advice on what I have so far
    By rumplestiltskin in forum Database Design
    Replies: 2
    Last Post: 05-25-2006, 12:48 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