A foreign key is a field in a table that identifies how one table is related
to another table. For example, if you have a table for Orders and another
one for Order Details, the foreign key would identify which record in the
Orders table each of the records in the Order Details table are related to.
Typically, the foreign key will store the value of the Primary Key from it's
"parent" table, although it could conceivably link to another unique
candidate key. Look at the table layout below.
Orders
OrderID -- Primary Key
OrderDate
-- Other fields related to the Order
OrderDetails
OrderDetailID -- Primary Key
OrderID -- Foreign Key linked to Primary Key of Orders table.
-- Other fields related to Order Details
The Orders table might contain the following
OrderID OrderDate SomeOtherField
1 4/24/06 BlahBlah
2 4/25/06 MoreBlahBlah
The OrderDetails Table might contain the following
OrderDetailsID OrderID OtherField
1 1 LaLaLa
2 1 LaLaLa
3 2 LaLaLa
--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security:
www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html