View Full Version : Simple Table Question


AWilderbeast
09-19-2005, 03:36 AM
Ive done this before in College but it was along time ago and i cant remember what i did

Bus say I have a table with Businesses and i need each business to be able to have multiple records associated with it.

So i have two tables one named 'businesses' and one named 'orders' how do i make sure that when a business makes an order the data in 'orders' is associated witht the releveant business in the 'businesses' table

marystewart78
09-19-2005, 04:35 AM
Firstly you need a field which is common to both tables ie businessref then you need to create a one to many relationship between the business and orders tables.

neileg
09-19-2005, 05:23 AM
You should be holding the primary key from the business table as a field in the orders table.

For data entry, you would usually handle this with a form and subform so that any time you enter an order in the subform, it will inheirit the PK of the business in the main form.

Pat Hartman
09-19-2005, 12:50 PM
Take a look at the Northwinds database. It is a simple order entry system and will give you a starting point.