I think I understand, but not sure. What I interpret is different from what Skip is interpreting. In this example I only demonstrate concatenating multiple records from DESC, but just expand the codes for other related tables. See if my example is right?
Master Table:
masterID ItemName
1 Item1
2 Item 2
DESC Table:
masterForiegnKey strDescription
1 2000 pounds
1 50 mph
1 Yellow paint
2 Four legs
2 Brown
The desired result.
New Master Table (with the concatenated data from DESC):
masterID ItemName concatenatedDescription
1 Item1 200 pounds, 50 mph, Yellow paint
2 Item 2 Four legs, Brown
If this is what you want to do, you may be able to use a combination of transform queries, but I think that doing this in code would be simpler. This would be my approach:
1) I would just build the concatenated fields right in the original Master table (ex concatenatedDescription), unless you really need a new table.
2) Build a seperate query for each related table that will be concatenated. (ex. qryMasterDESC and qryMasterINCL).
3)Now in code return a recordset, "rstMaster", from your Master table. All you really need is the primaryKey field returned, because you will loop trough each item in your Master table.
4) Now loop through your rstMaster getting each MasterID. Then create a new recordset, "rstQryMasterDesc", from your qryMasterDesc where the masterForiegnKey eqauls the MasterID.
5) Loop through rstQryMasterDESC and concatenate each strDESC value into a string variable.
6) When you have read each record in rstQryMasterDESC enter the string variable result into the concatenatedDescription field of the Master Table
7) Continue to loop through each item in the Master.
Here is some pseudo-like code to give you an idea. Not proper access code:
dim rstMaster as recordset
dim rstQryMasterDESC as recordset
dim strDESC as string
dim intMasterID as integer
set rstMaster = CurrentDb.OpenRecordset("tblMaster")
do while not rstMaster.end of file
intMasterID = rstMaster(“masterID”)
set rstQryMasterDESC = CurrentDb.OpenRecordset
("qryMasterDESC") where masterID = intMasterID
do while not rstQryMasterDESC.end of file
strDESC = strDESC & “,” & rstQryMasterDESC(“
strDescription”)
rstQryMasterDESC move to next record
loop “to next DESC”
rstMaster .edit
rstMaster(“concatenatedDescription”) = strDESC
rstMaster.update
loop “to next Item