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

Create One record from many records

Status
Not open for further replies.

djfeldspiff

Programmer
Apr 26, 2001
16
US
Good morning everyone,

I have an "Order" table that has the following for data:

Ord# Part# Zone
1 1 A
1 2 B
1 3 C

My goal is to create a separate table that reads the data from the "Order" table and produces the following:

Ord# Zone
1 A,B,C

I'm using Access2000. I know I need to loop through the records by Ord#, but am having some difficult with the Zone data and getting it to the desired output.

Any direction is greatly appreciated.
 
Why do you want to basically denormalize your data that way? However, if you want to do that, fill a recordset with the data you want, loop through the recordset and fill a string variable with the zone info like this:

Code:
sZone = sZone & "," & rsData(2)

sZone = mid(sZone,2) <-- removes the beginning comma

Next, add the data to your table.

Randy
[afro]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top