Sorry, the function I suggested wasn't quite complete. I was also in error about the UBound(strAry)-1.
Also, your field names have space so must be enclosed in [].
DLookup("Definition", "tblMRC_Code", "[MRC Rsn]='" & strAry(i) & "'")
This is main reason to avoid spaces and special characters/punctuation (underscore is exception) in naming convention. They are just annoying.
However, even the corrected function is not working. In first iteration of the loop the DLookup returns definition and then returns only Null for subsequent iterations in the loop. This is frustrating. I've never actually tried a DLookup in a function like this and this is unexpected. The result of this can be seen by calling the function from textbox:
=ParseString([MRC RSN])
Here is the code that runs without errors but just doesn't produce the desired output:
Code:
Public Function ParseString(strInput)
Dim strAry As Variant, i As Integer, strOutput As String
strAry = Split(strInput, ",")
For i = 0 To UBound(strAry)
strOutput = strOutput & DLookup("Definition", "tblMRC_Code", "[MRC Rsn]='" & strAry(i) & "'") & ","
Next
ParseString = strOutput
End Function
Not sure how to fix. Still thinking about it.
The ultimate final solution might require normalizing the imported data into a related table.