Ok, banged my head on this one enough. Found this function to condense several rows into one, concatenating a field, separating entries by commas.
I am getting an error message #3265 Item not found in this collection on the line I've highlighted in Red. I can't figure out what I could be doing wrong and was hoping I could get some direction.
I have this in Query1 (built from "qConstraints") with the following fields:
RB_STY_ID
Field1: Conc("MAN_CON_DESC","RB_STY_ID",[RB_STY_ID],"qConstraints")
Public Function Conc(Fieldx, Identity, Value, Source) As Variant
Dim cnn As DAO.Connection
Dim rs As DAO.Recordset
Dim SQL As String
Dim vFld As Variant
vFld = Null
SQL = "SELECT [" & Fieldx & "] As Fld" & _
" FROM [" & Source & "]" & _
" WHERE [" & Identity & "]=" & Value
' open recordset.
Set rs = CurrentDb.OpenRecordset("qConstraints", dbOpenDynaset)
' concatenate the field.
Do While Not rs.EOF
If Not IsNull(rs!Fld) Then
vFld = vFld & ", " & rs!Fld
End If
rs.MoveNext
Loop
' remove leading comma and space.
vFld = Mid(vFld, 3)
Set cnn = Nothing
Set rs = Nothing
' return concatenated string.
Conc = vFld
End Function
Thanks!