"Piotr Sobolewski" <NI********@gazeta.plwrote in message
news:gb**********@inews.gazeta.pl...
>
are there any aggregating functions in Access that can concatenate
(glue together) text?
If you are trying to concatenate values from related records into a string
to use with the main record, use a function like this:
http://allenbrowne.com/func-concat.html
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(strDelim 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.