Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same orderID, multiple products 2

Status
Not open for further replies.

caldee

IS-IT--Management
Aug 29, 2002
8
US
This may get the "Stupid Question of the Day" Award, but here goes...

How do I add multiple products to the same orderID?
Example: I have a form with customer info and a subform with order info but I can add only one product to that order. In order for the customer to buy 2 different products, you have to create 2 seperate orders.

Thanks in advance!
 
Sounds like your tables aren't set up properly...I think in this case you need 3 tables...one for customer, one for order, and one for line item...that way you get one to many relationships for all three (line item would basically be each line of an order, so it would have a primary key and then have orderID as a foreign key). With this setup you'd probably want the Order table to be your main form (with some way to select the correct customer ID to include with the record) and then have the line item table as your subform. Hope this helps...and makes sense.

Kevin
 

Nope. You don’t get the stupid question award of the day.

But, you do need to take a step backwards and think a bit.

Let’s discuss customer info. I am your customer. You have my name, my company, my address, my billing address, which address I wish to use to have your products shipped to. You have my credit card number(s)..all kinds of interesting things about me. And I have just told you I want to buy 3 reference books at about $125.00 a piece. So now you are a happy camper. You are going to make around $375.00 just as soon as I click that good old accept button…but…..time for you to panic. You don’t know if I want all 3 books shipped at the same time. You don’t know if one book goes to a client site and another to my office. Quick. Think. You’re going to blow this sale big time. You know nothing about the ORDER. The order really doesn’t care too much about customer info. The order info points to another table which maps items to order number.

So that, in one order, I can have hundreds of items, and simply by skimming my orders table I can track all products for any given number of orders.

This should get you started in the right direction.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thank you both!
I think I am on the right track now.
I'll rethink this and try again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top