For example: if the user writes apple instead of red apple it does not search the word. but if the user writes red it searches the word.
Is there any way I could achieve this?
Code: Select all
var = Me.txtSearch
Set cnn = New ADODB.Connection
If CheckBox2 = True Then
strSQL = "SELECT [Code],[Cat] FROM Dummy WHERE [Code] = '" & var & "' OR [Cat] = '" & var & "'"
Else
strSQL = "SELECT [Code],[Cat] FROM Dummy WHERE [Code] LIKE '" & var & "%' OR [Cat] LIKE '" & var & "%'"
End If