|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Insert a multiple selection into a table
I'm currently attempting to do something way over my head in Access 2003. The relevent tables are:
products prodid (PK) name description price shopping_basket basketid (PK) custid prodid The listbox on the form runs from a query that gets just the id and name of each product from the product table. What I want is for the user to select one or more products from a listbox on a form and, along with the customer id, be inserted into the shopping basket table. What I'm trying to do is concatenate the string so each selected product id is put into one row in the shopping basket table. Ie, if product id 1 and 3 are selected, the string 1,3 is inserted into the table. One way I've thought to do this is to use a loop that put each selected product into a string, which is what is inserted into the table. Or am I going completely the wrong way? |
|
#2
|
||||
|
||||
|
would be better if you created one table more, which will contain the choosed products:
shopping_basket basketid (PK) custid shopping_basket_products basketid (FK) prodid (FK) Quantity and then have product 1 and 3 at one row each. |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Insert a multiple selection into a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|