Re: Query Question



You would need to split all the names out into separate records. And your example showed that names were split by commas or semi-colons. I suspect that other methods (Colons, Slashes, or dashes might also have been used.


First, add this function to a module so you can call it in a query

Public Function fGetSection(StrIn, iSection As Integer, _
Optional strDelimiter As String = ";")
Dim vArray As Variant

If Len(StrIn & vbNullString) = 0 Then
fGetSection = StrIn
Else
vArray = Split(StrIn, strDelimiter, , vbTextCompare)
iSection = iSection - 1
If iSection > UBound(vArray) Then
fGetSection = Null
Else
fGetSection = vArray(iSection)
End If
End If

End Function
.