Just need a quick pointer on my search setup.
I have a Query called 'SearchQ'.
Within it there are 8 different fields listing each customer's information.
My search Form 'SearchF' has:
1.) A textbox called 'Phonesearch' for inputting the value to be searched
2.) A listbox called 'SearchCustomerResultsListBox' for displaying the search results
3.) a button for starting the search
Here is my code after clicking on the "search button" next to the input field for the search.
Private Sub Command0_Click()
Dim W As String
Dim S As String
W = ""
S = ""
If Not IsNull(PhoneSearch) Then
W = " PhoneCell LIKE ""*" & PhoneSearch & "*"" "
End If
S = "SELECT [CustomerID],[FirstName], [LastName], [PhoneCell], [PhoneHome], [PhoneWork],[EmailPersonal], [EmailWork] FROM SearchCustomerQ "
If W <> "" Then
S = S & " WHERE " & W
End If
S = S & "ORDER BY [LastName], [FirstName]; "
SearchCustomerResultsListBox.RowSource = S
End Sub
I'd like the Code to search not just the 'PhoneCell' directory but also the 'PhoneHome' and 'PhoneWork' sections as well.
Thanks in advance!