As noted oneday, when in an early post on SO it is easier with ADO: Request example:
SELECT [Order Number], ConcatADO("SELECT [Product Types] FROM Orders WHERE [Order Number]=" & [Order Number],", "," : ") AS Cat FROM Orders GROUP BY [Order Number], 2;
Function Using ADO
Function ConcatADO(strSQL As String, strColDelim, _ strRowDelim, ParamArray NameList() As Variant) Dim rs As New ADODB.Recordset Dim strList As String On Error GoTo Proc_Err If strSQL <> "" Then rs.Open strSQL, CurrentProject.Connection strList = rs.GetString(, , strColDelim, strRowDelim) strList = Mid(strList, 1, Len(strList) - Len(strRowDelim)) Else strList = Join(NameList, strColDelim) End If ConcatADO = strList Exit Function Proc_Err: ConcatADO = "***" & UCase(Err.Description) End Function
source share