A form that submits multiple rows

nicksource

Registered User.
Local time
Today, 19:31
Joined
Feb 18, 2008
Messages
69
How would I do this?

I have a table that is like this:

ID | OrderID | ProdID

The ID is unique.

What happens is there could be an order for several different products, like this on the same order:

ID | OrderID | ProdID
1.......001..........24
2.......001..........17
3.......001..........19
4.......002..........12
5.......003..........24
6.......003..........11


When I create a form, it shows all the fields I want to input but then I want about 10 boxes to select products and quantities in, that when you do, it creates a new row in the table, with duplicate data according to the rest of the fields but with the different product selected. At the moment, I can only make it do a single ProdID for a single row.

I hope this makes sense. Any help would be greatly appreciated!
 
First thing, why limit the user to only ten options? What happens if they want to order eleven? This approach isn't the workable one.

What you need to do is look into forms and subforms. No doubt you'll need a table for customers, a table for products, and a junction table for orders containing the primary keys of the customer and product tables.

You may want to - or even just adapt - the Northwind Database to your purposes.
 
That's the structure I have actually. :) I just don't know how to do the forms?
 
As I say, take a look at the Northwind Database.

If you open up a new form in Design View and place a subform object on the form then the Subform Wizard should start up and guide you through creating your subform. Then it's a case of linking Child and Master fields to common keys between both form and subform's underlying RecordSource.
 

Users who are viewing this thread

Back
Top Bottom