Return a string containing the values of related records.
If you just want to stick together an unpredictable number of strings that
you want to pass in, use a functon that accepts a ParamArray, like this:
Function ConcatFields(st rDelim As String, ParamArray varList()) As Variant
Dim strout As String
Dim i As Integer
For i = LBound(varList) To UBound(varList)
If Not IsNull(varList( i)) Then
strout = strout & varList(i) & strDelim
End If
Next
i = Len(strout) - Len(strDelim)
If i 0 Then
ConcatFields = Left(strout, i)
Else
ConcatFields = Null
End If
End Function
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
Comment