I had something like below in my asp page :
Code:
strsql = " select * from myTable where 1 = 1 and "
If Request.Form("searchTerm") <> "" Then
Dim strSearchj, arrKeyWordsj, xj
Dim strWherej, curKeyWordj
strSearchj=request("searchTerm")
arrKeyWordsj=Split(strSearchj, ",")
strWherej=""
For xj=0 To UBound(arrKeyWordsj)
curKeyWordj=Replace(arrKeyWordsj(xj), "'", "''")
If Len(curKeyWordj)>0 Then
strWherej=strWherej&"myTable.FieldToBeSearchedForKeywords LIKE '%"&curKeyWordj&"%' OR "
End If
Next
If Len(strWherej)>0 Then
strsql = strsql & " And"
strWherej=Left(strWherej, Len(strWherej)-Len("OR "))
strsql=strsql&" ("&strWherej&")"
End If
End If
I know how it can be done in an asp page, but do not know how this can be integrated in to VBA & then in to the form or report.
Thanks