I want to add radio buttons to my search form that will limit the text search to only the column specified with the radio button. For example, if the first radio button is selected I only want the form to search for the matching text in column 1, not throughout the enter form. If the second radio button is selected I only want the form to search for the text in column 2. So on and so on.
Do I need to put the code in the radio button 'on got focus' event or in the txtsearch event? I essentially need the radio buttons to act as a filter for my txtSearch.
I also need the search to only find exact matches. For example, I have both "dishwasher" and "washer" as data in my form. If I search 'washer' I do not want any 'dishwasher data' to pull.
My current code is below:
Private Sub Command662_Click()
Dim strsearch As String
Dim strTextsearch As String
strText = Me.TxtSearch.Value
strsearch = "SELECT * from ProcurementDatabase where ([SKU #] like ""*" & strText & "*"") or (Supplier like ""*" & strText & "*"") or ([Item Type] like ""*" & strText & "*"") or (Model like ""*" & strText & "*"") or (Property like ""*" & strText & "*"")"
Me.RecordSource = strsearch
End Sub
Private Sub TxtSearch_AfterUpdate()
Call Command662_Click
End Sub