When you say you have a table for products, do you mean you have a table
that lists *only* products? Each truckload consists of some quantity of a
product. It makes a difference in the design, by the way, if a truckload
ever consists of more than one product. In either case, the Product table
is more or less static, which is to say products are added to it only
occasionally. On the other hand, a new record is added to the Truckload
table every time a truck is loaded. Assuming that a truckload consists of
only one product, you may have a structure something like this:
tblProduct
IngredientNo (primary key, or PK)
Description
UnitSize
PricePerUnit
other fields specific to the product
tblTruckload
BillOfLadingNo (PK)
IngredientNo (foreign key, or FK)
DateShipped
Destination
other fields specific to the truckload
There is a one-to-many relationship between the two IngredientNo fields,
which you can create in the Relationships window. Note that the PK field is
designated in table design view, but that the FK field becomes the foreign
key because of its relationsip to the PK. It is not designated in table
design view as the FK. It needs to be the same data type as the PK, or Long
Integer if the PK is autonumber.
If each truckload can consist of several products (which I assume is the
case since you mention Minor Ingredients), and each product is part of many
truckloads over time, there is a many-to-many relationship between Products
and Ingredients. A third table is needed to resolve this relationship:
tblProductTruckload
ProdTruckNo (PK)
IngredientNo (FK)
BillOfLadingNo (FK)
QuantityShipped
PricePerUnit
other fields specific to a particular product in a particular truckload
Note that IngredientNo would not be a part of tblTruckload in this scenario,
and that there is no direct relationship between tblIngredient and
tblTruckload.
The three-table scenario assumes you would want to look at the Truckload
records to see what Ingredients were shipped, and that you would want to
look at the Ingredient records to see the Truckloads in which they were
included.
Similar decisions need to be made about suppliers, customers, packaging, and
anything else involved. You will probably want to store the customer's
Address information in tblTruckload (assuming each truckload goes to a
single customer) so that you can look back and see the actual address to
which the truckload was shipped, but for billing purposes you want the
current address. For UnitPrice, you want to store the price at the time the
Ingredient was shipped, the but price in tblProduct will need to be updated
from time to time. With packaging, you need to decide if you want to track
the use of packaging (maybe for inventory control, or cost analysis, or
whatever).
These are some of the questions that should be answered before you make the
first form. The best way to work out a design is with a pencil and some
paper, keeping in mind that a table should store information about a single
entity (truckload, ingredient, etc.).