Could someone please look at the below module and query and tell me if you know why I am getting a data type mismatch error when running?
Both fields in the table are "Text" so I don't get why it's doing this. Found this code on another site.
Module
Public Function Concat(strDEV_CD As String, _
strConstraint As String) As String
Static strLastDEV_CD As String
Static strConstraints As String
If strDEV_CD = strLastDEV_CD Then
strConstraints = strConstraints & ", " & strConstraint
Else
strLastDEV_CD = strDEV_CD
strConstraints = strConstraint
End If
Concat = strConstraints
End Function
Query
SELECT DEV_CD, Max(Concat(DEV_CD,MAN_CON_DESC)) AS Constraints
FROM [Copy Of q_Combined]
GROUP BY DEV_CD;
Thanks!