Hi everyone,
Right now I have a text box to search any keyword in the respective fields (in this case, this keyword searches any name within the "Last Name" column and the "First & Middle Name" column)
I am wondering how I would go about having two textboxes for their respective fields to search for the record of interest?
i.e I would like to have one textbox for "Last Name", be able to click search to show up all the results for lets say those who have the last name as "McDonald" and then when I enter a second textbox for "First & Middle Name", it will search for the name i type in within the previous filtered search of :McDonald" as the last name.
This is the code I have so far for my single textbox search that searches within the two fields of LAST NAME and FIRST & MIDDLE NAME:
Private Sub btnSearch2_Click()
Dim SQL3 As String
SQL3 = "SELECT [IDList].[ID], [IDList].[TRANSACTION CODE], [IDList].[LAST NAME], [IDList].[FIRST & MIDDLE NAME], [IDList].[SPECIALTY], [IDList].[INTEREST], [IDList].CITY, [IDList].PROVINCE, [IDList].[POSTAL CODE], [IDList].[CODE] " _
& "FROM [IDList] " _
& "WHERE [LAST NAME] LIKE '*" & Me.txtKeywordz & "*' " _
& " OR [FIRST & MIDDLE NAME] LIKE '*" & Me.txtKeywordz & "*' " _
& " OR [ID] LIKE '*" & Me.txtKeywordz & "*' " _
& " ORDER BY [IDList].[LAST NAME]; " _
Me.subFIND.Form.RecordSource = SQL3
Me.subFIND.Form.Requery
End Sub