Public Function Concat(ParcelID As String) As String
Dim rs As DAO.Recordset
Dim strTopic As String
Dim StrSQL As String
StrSQL = "SELECT DISTINCT [Legal_Description] FROM Resources_Parcel_Legal WHERE Parcel_ID='" & ParcelID & "'"
Set rs = CurrentDb.OpenRecordset(StrSQL)
rs.MoveFirst
Do Until rs.EOF
strTopic = strTopic & rs![Legal_Description] & ", "
rs.MoveNext
Loop
If Len(strTopic & "") > 0 Then
strTopic = Left(strTopic, Len(strTopic) - 2)
Else
strTopic = ""
End If
Concat = strTopic
End Function
|