Is there a way that I can search whole words in a line rather than just search every letter.
ie when I am searching I will type AC (air conditioning) in a text box to search for only AC words but my code returns every two letters together that are ac therefore I will get "accept", "active" etc. but I only want AC as a whole word.
But I also want it anywhere in the line so if I have the line
"The AC is no longer active" I want it to return the record.
The code
Private Sub CmdFilter_Click ()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtca use) Then
strWhere = strWhere & "([Cause] Like ""*" & Me.txtcause & "*"") AND "
End If
End sub
ie when I am searching I will type AC (air conditioning) in a text box to search for only AC words but my code returns every two letters together that are ac therefore I will get "accept", "active" etc. but I only want AC as a whole word.
But I also want it anywhere in the line so if I have the line
"The AC is no longer active" I want it to return the record.
The code
Private Sub CmdFilter_Click ()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtca use) Then
strWhere = strWhere & "([Cause] Like ""*" & Me.txtcause & "*"") AND "
End If
End sub
Comment