I have two tables -
- one containing box details including box numbers (unique; key field)
- another containing master cartons details, including master carton numbers (unique; key field)
A master carton can hold 4 boxes.
- A box cannot be added to more than one master carton.
- Each master carton can hold 4 boxes or less
- A box may be removed from a master carton (and another may be added in its place)
The box table has a reference column for master carton numbers. Every time a box goes into a master carton, I add the master carton number to the box’s record (i.e. row) from the reference list.
- How do I ensure that a master carton number is not added to more than 4 boxes?
- Different types of master cartons have differing capacities. If I have a “capacity” column for each master carton, how do I limit the addition of boxes to a master carton, w.r.t. it’s capacity?