access 2010
The below takes the search word(s) delimited my a comma and searches a field.
On the below code, if the user enters a comma and space between search words, how can I strip the space, but strip the space only if it is after the comma?
Private Sub Command25_Click()
Dim strFilter As String, strFilters() As String
Dim intX As Integer
With Me
strFilters = Split(Nz(.Text23, ""), ",")
For intX = 0 To UBound(strFilters)
strFilter = strFilter & _
Replace(" OR ([EmployeeName] Like '*%F*')", _
"%F", strFilters(intX))
Next intX
.Filter = Replace(Mid(strFilter, 5), "'", Chr(34))
.FilterOn = (.Filter > "")
End With
End Sub
The below takes the search word(s) delimited my a comma and searches a field.
On the below code, if the user enters a comma and space between search words, how can I strip the space, but strip the space only if it is after the comma?
Private Sub Command25_Click()
Dim strFilter As String, strFilters() As String
Dim intX As Integer
With Me
strFilters = Split(Nz(.Text23, ""), ",")
For intX = 0 To UBound(strFilters)
strFilter = strFilter & _
Replace(" OR ([EmployeeName] Like '*%F*')", _
"%F", strFilters(intX))
Next intX
.Filter = Replace(Mid(strFilter, 5), "'", Chr(34))
.FilterOn = (.Filter > "")
End With
End Sub