View Single Post
  #4  
Old November 20th, 2009, 11:43 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Using Access 2003

You need to create the 1 to many relationship between table called customers
and a table called orders with the primary Key CustomerID and the foriegn key
in Orders. Select options Referential Integerity and Cascade Update.

If you can not set the relations due to error it will be that you have one
or more records in the Orders table that does not have a matching CustomerID.

Run an 'unmatched' query to find and fix the records. Complete setting the
relationship.

Use a form/subform for customer/orders with Master/Child links with
CustomerID.

CustomerID does not need to be shown on the subform. As you add a new record
in the subform the CustomerID will automatically inserted in the Orders table.

Scrolling through the Customers in the main form you only see the orders
related to that Customer shown on the main.

--
Build a little, test a little.


"Jennifer" wrote:

I have one table called customers and a table called orders. The primary Key
is CustomerID and the foriegn key is attached to Orders. I then created and
orders and customer forms. I want it so that when I have a Customer name on
the first form I only want orders from that customer to show up on the orders
form. I have tried creating a 1 to many relationship. That did not work for I
deleted. I did a insert a subdatasheet but it only saved that first
cumstomer's information. Please help? Jennifer