Re: Query Question
- From: John Spencer <spencer@xxxxxxxxxx>
- Date: Sat, 07 Jul 2007 13:34:16 -0400
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
.
- Follow-Ups:
- Re: Query Question
- From: John Spencer
- Re: Query Question
- Prev by Date: Re: Returning too many lines
- Next by Date: Re: How can I create a multiple field search box? (corrected post)
- Previous by thread: Merge two tables
- Next by thread: Re: Query Question
- Index(es):