As a follow-on from what @krish-km mentioned, here's a function I've adapted from
Allen Browne's ConcatRelated function (note that I've removed a lot of the original's general purpose utility, so should only be used for your specific scenario).
Put this in a VBA module...
Code:
Public Function ConcatRelated(strField1 As String, _
strField2 As String, _
strRelField As String, _
lngRelFieldVal As Long, _
strOrderBy As String, _
strTable As String, _
Optional strSeparator = ", ") As Variant
On Error GoTo Err_Handler
Dim db As DAO.Database ' Database
Dim rs As DAO.Recordset '
Dim strSql As String ' SQL statement
Dim strOut As String ' Output string to concatenate to.
Dim lngLen As Long ' Length of string.
' Initialize to Null
ConcatRelated = Null
' Find related records limited by related field
strSql = "SELECT " & strRelField & ", " & strField1 & ", " & strField2 _
& " FROM " & strTable & " WHERE " & strRelField & " = " & lngRelFieldVal _
& " ORDER BY " & strOrderBy
Set db = CurrentDb
Set rs = db.OpenRecordset(strSql)
' Loop through related fields to build comma separated list
Do While Not rs.EOF
strOut = strOut & rs.Fields(strField1) & ": " & rs.Fields(strField2) & strSeparator
rs.MoveNext
Loop
rs.Close
' Return the string without the trailing separator.
lngLen = Len(strOut) - Len(strSeparator)
If _
lngLen > 0 _
Then
ConcatRelated = Left(strOut, lngLen)
End If
Exit_Handler:
'Clean up
Set rs = Nothing
Set db = Nothing
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbExclamation, "ConcatRelated()"
Resume Exit_Handler
End Function
You'll then be able to use this function in an SQL statement.
The first and second arguments are your 2 fields that you want to concatenate in to the comma-separated list; these are passed as strings so use double-quotes.
The third and forth argument is the the field whose value is the same across the records you're trying to summarise (in your case it's PipeID). Note that argument 3 needs to be in double-quotes "PipeID" and argument 4 is the sql-reference field, so mustn't be in quotes tblTvObservations.PipeID.
The fifth argument is the field you've specified in either strField or strField2 that you want the comma separated list to be ordered by.
The sixth and final argument is the table/query name where this data comes from.
Here's an example of it used in an sql query...
Code:
SELECT tblTvObservations.PipeID, ConcatRelated("TVObservation","NumberOf","PipeID",tblTvObservations.PipeID,"TVObservation","tblTvObservations") AS NumberOf
FROM tblTvObservations;
...to get the following result: