How do I add data from a query to a subdatasheet?

L

Lost

I want to show each customer that has purchased a specific product. each
record is a product. I have built a table titled tblCustomers and joined it
with my inventory table as a subdatasheet. I have select queries with the
records I want to update/append to the tblCustomers. How do you do this so
it shows EACH customer that has purchaes the product?
 
J

John W. Vinson

I want to show each customer that has purchased a specific product. each
record is a product. I have built a table titled tblCustomers and joined it
with my inventory table as a subdatasheet. I have select queries with the
records I want to update/append to the tblCustomers. How do you do this so
it shows EACH customer that has purchaes the product?

If you've just *created* a Customer table, how do you know which customer
purchased which product??? Does each project have one and only one customer?

To handle the typical many to many relationship (each customer can buy one or
more products, each product can be bought by one or more customers) you need
*a third table* - Purchases perhaps. This table would have a record with the
CustomerID of the purchaser, and the ProductID of the product.

See the Northwind sample database for an example of how this can be set up.
This uses four tables: Customers related one-to-many to Orders; Orders
one-to-many to OrderDetails; and OrderDetails many-to-one to Products.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top