Hi all;
I'm using this great bit of code to concatenate a fields from multiple rows into a single one.
I tent to call the code using:
The problem I'm having is that I'm getting a Data Type Mismatch whenever I'm using a Number field as strGroup and a text field as strItem. Unfortunately I can't change the design of the underlying tables, the number fields have to remain as number fields.
Is there any way of tweaking the code to make it work with mixed data types? I've tried to look up info for CStr() but there's not much useful stuff out there!
Thanks!
I'm using this great bit of code to concatenate a fields from multiple rows into a single one.
Code:
'Concat Returns lists of items which are within a grouped field
Public Function Concat(strGroup As String, _
strItem As String) As String
Static strLastGroup As String
Static strItems As String
If strGroup = strLastGroup Then
strItems = strItems & ", " & strItem
Else
strLastGroup = strGroup
strItems = strItem
End If
Concat = strItems
End Function
Code:
max(concat([tbl1]![field1],[tbl2]![field2]))
Is there any way of tweaking the code to make it work with mixed data types? I've tried to look up info for CStr() but there's not much useful stuff out there!
Thanks!
Comment