Hi! Actually I had a code that the use is, I will search for a multiple data that can be separated by comma.
For Example : I put [apple, banana] on my textbox(exact as what you see on the []) and I have a record on my database named :
♦apple1
♦apple2
♦apple3
♦banana2
♦banana1
♦carrot1
♦carrot2
and when I press the Search Button it will show me all records that has APPLE and BANANA in the table.
but the problem of my code is when I put a value on the textbox like BANANA or whatever word it is. It will just filter my 50k+ record into 300records which is surely wrong, because it must show me the record that has BANANA word in the table.
Here's the code :
LEGEND :
• Command26 - Button that I consider as a Search/Filter Button
• Text24 - Textbox where will I put the value that I'm looking
• Card_Number - Name of the column where what I' am searching is Located.
I'm still playing on the code, but still I need someones help. Thank you in advanced.Code:Private Sub Command26_Click() Dim strFilter As String, strFilters() As String Dim intX As Integer With Me strFilters = Split(Nz(.Text24, ""), ",") For intX = 0 To UBound(strFilters) strFilter = strFilter & _ Replace(" OR ([Card_Number] Like '%F*')", _ "%F", strFilters(intX)) Next intX .Filter = Mid(strFilter, 5) .FilterOn = (.Filter > "") End With End Sub![]()