I found a work around but I didn't figure out why your code was failing.
It seemed to be a problem passing the separator and/or a null somewhere but admittedly I didn't look too hard.
I just added an optional argument - UseNewLine as boolean
This way the original code's unchanged.
Code:
Public Function ConcatRelated(strField As String, _
strTable As String, _
Optional strWhere As String, _
Optional strOrderBy As String, _
Optional strSeparator = ", ", Optional UseNewLine As Boolean = False) As Variant
And then added a line
Code:
If UseNewLine = True Then strSeparator = vbNewLine
Here's how I called it in the control source of a textbox in a contiguous form. (Obviously using my own tables)
Code:
=ConcatRelated("CaseID","tblAssigned","StaffID = " & Nz([Forms]![Form4]![StaffID],0),"CaseID","",True) ' uses the new line
=ConcatRelated("CaseID","tblAssigned","StaffID = " & Nz([Forms]![Form4]![StaffID],0),"CaseID") 'use the default comma
Edit: Looking closer I think you have nulls in your criteria that needs to be handled with Nz()