Duplicating multiple items by multiple customers

L

LDMueller

I need to be able to do something and I'm not sure if it's possble. I need
to be able to enter several item like the following:

ProductID Product Discription
87765 Ball Baseball
25934 Bat Wooden Bat
59842 Glove Leather Glove

The number of items may change depending on how many items are ordered.

Once I have the order, I want to be able to enter all the customer numbers
(e.g. CustID) who have placed this exact order because it could have been 20
customers. This way I would end up with 60 entries like the following:

CustID ProductID Product Discription
B002 87765 Ball Baseball
B002 25934 Bat Wooden Bat
B002 59842 Glove Leather Glove
B041 87765 Ball Baseball
B041 25934 Bat Wooden Bat
B041 59842 Glove Leather Glove
B487 87765 Ball Baseball
B487 25934 Bat Wooden Bat
B487 59842 Glove Leather Glove
B593 87765 Ball Baseball
B593 25934 Bat Wooden Bat
B593 59842 Glove Leather Glove

I can figure out how to enter one item (like bat) and add it to all the
CustIDs by using the duplicate button or by setting the Default Value so that
whatever the last value in a field was, becomes the Default Value entered for
a New record.

The problem with this scenario is I would have to enter the number of
CustIDs by the number of items so it's more work.

Can anyone point me in a direction on how to achieve this and if required,
provide some sample code.

Thank you so much!

LDMueller
 
Z

zz

We'll need to know your table structures to answer your question.
Do you have a table to contain an order (as in first 3 records)?
Do you have a table of customers?
Once you have an order defined and customers defined, it is a simple matter.

-Dorian
 
L

LDMueller

Hello,

Thank you for your response.

Yes, I have a table to contain an order as follows:
ORDERS (table name)
CustID (field)
ProductID (field)
Product (field)
Discription (field)

And I have a table of customers as follows:
CUSTOMERS (table name)
CustID (field)

CUSTOMERS.CustID is linked to ORDERS.CustID as a one (CUSTOMERS) to many
(ORDERS).

Thanks!
 
J

John W. Vinson

Can anyone point me in a direction on how to achieve this and if required,
provide some sample code.

Add another table (OrderDetails say) with fields for the OrderNo and
ProductID; remove the ProductID from your Orders table. You have a many to
many relationship, not a one to many.

See the Northwind sample database Orders form which came with Access. No code
is needed - just another table to correctly model the relationship.
 

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