I want to find out if the string "Bolo" is contained in a text field in my recordset
and avoid the field "spagetti bolonhese", but I wanting to find the field
"bolo marble chocolate"
the folowing finds both
so I tought I should add a space before and after the search string to avoid "spagetti bolonhese", but is finds neither of them
Any toughts on how to find
Marble Bolo
Bolo Marble
and not to find :
Bolachas Mary
Mary Bolachas
Bolognese
and avoid the field "spagetti bolonhese", but I wanting to find the field
"bolo marble chocolate"
the folowing finds both
Code:
If rst(1) Like "*" & Term & "*" Then
so I tought I should add a space before and after the search string to avoid "spagetti bolonhese", but is finds neither of them
Code:
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tblProdutos", dbOpenDynaset)
Dim n As Integer, str as string
str="Bolo"
str= " " & str & " "
With rst
While Not .EOF
If rst(1) Like "*" & str & "*" Then
' here I do something
End If
.MoveNext
Wend
End With
Any toughts on how to find
Marble Bolo
Bolo Marble
and not to find :
Bolachas Mary
Mary Bolachas
Bolognese