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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update table based on multiple rows of Select Query 1

Status
Not open for further replies.

freebirdnal

Programmer
Oct 22, 2004
1
US
I am struggling with something I have locked myself into:

I have 2 tables with a one to many relationship. I need to update the single based on the multiple corresponding rows.

table1
itemNumber (PK)
colorsAvail

1
|
|
MANY

table2
itemNumber \
size | together make up PK
color /
qtyInStock

I use:

SELECT DISTINCT table2.itemNumber, table2.color
FROM table2
WHERE ((table2.qtyInStock)>0);

to get rows of individual colors in stock for each item. And I want to use these multiple rows on each item to create the table1.colorsAvailable field as a string of colors "red, green, blue"

I've been fiddling with ADO and VBA but my knowledge is limited- im sort of teaching myself as i go along. ive gotten nowhere.

Can anyone help me with some code to accomplish this? It's holding up my whole project (probably should have considered my abilities before i designed this) and im feeling pretty frustrated. thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top