Steps:
1. In the first module function are defined:
Public Function GroupConcat (sColumn As String, sTable As String, Optional sCriteria As String, Optional sDelimiter As String=", "
On Error GoTo ErrHandler
Dim the rs As New ADODB. You
Dim sSQL As String
Dim sResult As String
SResult=""
SSQL="select" & amp; SColumn & amp; "From" & amp; STable
If sCriteria & lt;> "" Then
SSQL=sSQL & amp; "Where" & amp; SCriteria
End the If
Rs. The Open sSQL CurrentProject. Connection, adOpenForwardOnly, adLockReadOnly
EOF
the Do While Not rs.If sResult & lt;> "" Then
SResult=sResult & amp; SDelimiter
End the If
SResult=sResult & amp; Rs. Fields (0). The Value
Rs. MoveNext
Loop
Rs. Close
Set the rs=Nothing
GroupConcat sResult=
The Exit Function
ErrHandler:
If the rs. State & lt;> AdStateClosed Then
Rs. Close
End the If
Set the rs=Nothing
GroupConcat=Err. Number & amp; ":" & amp; Err. The Description
End the Function
2. Write a query and execute
The SELECT T_Person_Course. Name, GroupConcat (' Course ', 'T_Person_Course', 'Name=' & amp; "'" & amp; The Name & amp; "'") AS Courses
The FROM T_Person_Course
GROUP BY name
Execution of the query, actually the original field type is "note", data length is longer, merged into a "text", lead to data truncation, consult great god how to solve?