And how can I use it with my following code so that if an option is selected which requires all the words entered in a text box to be joined by and or search it as a phrase or search tem by joining with or. All the options is in the combobox?

Thanks

VB Code:
  1. Private Sub cmdSearch1_Click()
  2. Dim sTarget As String
  3. Dim wordcount As Integer
  4. Dim i As Integer
  5. moRS.MoveFirst
  6. sTarget = Replace$(txtSearch1.Text, "*", "%")
  7. sTarget = Replace$(sTarget, "'", "''")
  8. Dim sqlsearch() As String
  9. sqlsearch = Split(sTarget, Chr(32), 1)
  10. wordcount = UBound(sqlsearch) + 1
  11.  
  12.  
  13. 'Decide on right SQL statement
  14. If optKeyword.Value = True Then
  15. moRS.Find "Keywords like '" & sqlsearch & "'"
  16. ElseIf optTitle.Value = True Then
  17. moRS.Find "Article_Name like '" & sqlsearch & "'"
  18. ElseIf optAuthor.Value = True Then
  19. moRS.Find "Author like '" & sqlsearch & "'"
  20. ElseIf optJournaltitle.Value = True Then
  21. moRS.Find "Journal_Name like '" & sqlsearch & "'"
  22. End If
  23.  
  24.  
  25. If moRS.EOF Then
  26. MsgBox "no match found", vbOKOnly, "sorry"
  27. Else
  28. MsgBox "found " & moRS.Fields("Journal_Name").Value
  29. End If
  30. End Sub