Sorry, but I have to ask why you need this. If you need to show the en and sp together on a form or report, you can use a list box for a form or two detail records on a report.
By doing what you want to do, you are de-normalizing data, which is generally not a good idea.
If you really need to do this you would need to make sure that your query sorts on all the fields in order.
Then your code would have to step through each record and store the values of the first three fields. As long as those three stayed the same, you would build a concatenated string of the fourth field, lan.
You could put the results into a temporary table, call it tblTemp.
something like this
dim rstData as recordset
dim rstTemp as recordset
dim strPart as string
dim strCD as string
dim strComp as string
dim strLang as string
set rstData=currentdb.openrecordset("yourQueryName"
rstdata.movefirst
strPart = rstdata!part
strCD=rstdata!cd
strComp=rstdat!comp
do until rstdata.eof
'compare with previous record's data
'this is meaningless for first record
if (strPart = rstdata!part and strCD=rstdata!cd and strComp=rstdat!comp) then
strLang = strLang & ", " & rstData!lang
else
'if it does not equal then use the last value of
'the strings to write record to temp file
rstTemp!addnew
rsttemp!part = strPart
rsttemp!cd=strCD
rsttemp!comp = strComp
rsttemp!lang=strlang
rsttemp.update
'then reset the values of all the string to the new values
strPart = rstdata!part
strCD=rstdata!cd
strComp=rstdata!comp
strLang=rstdata!lang
end if
rstData.movenext
loop
NOTE: this is not exact code. It does not include any error checking and it it off the top of my head. I hope it gets you started. Kathryn