Hi! I had a code that can search a data just using keyword like 123 it will show me the record that has 123 like "31231", "32123", etc. but I want to search multiple record which can be separated by comma like [123, 456] and the result will show me the record that is..
31231
32123
32456
24561
LEGEND
• GOLDNEWCONNECT = Database/Table
• GOLDNEWCONNECT_ValidateSubform = Subform on my main form
• GOLDNEWCONNECT_ValidateBatch = The name of the main form
• Text30 = Textbox where SR Number will be putted
• Text34 = Textbox where Emboss Name will be putted
I had a code like this.
This will search the SR Number, which I change the code in the BuildFilter because I want to search multiple record which is separated by Comma which has an error.
BUTTON CODE FOR SR NUMBER
Code:
Private Sub Command33_Click()
'Update the record source
Me.GOLDNEWCONNECT_ValidateSubform.Form.RecordSource = "SELECT * FROM GOLDNEWCONNECT " & BuildFilter
' Requery the subform
Me.GOLDNEWCONNECT_ValidateSubform.Requery
End Sub
and this will search for the Emboss Name which I didn't change the code. For you also to see the search Like code, It's running but it doesn't search in multiple, just one at a time.
BUTTON CODE FOR EMBOSS NAME
Code:
Private Sub Command36_Click()
'Update the record source
Me.GOLDNEWCONNECT_ValidateSubform.Form.RecordSource = "SELECT * FROM GOLDNEWCONNECT " & BuildFilter
' Requery the subform
Me.GOLDNEWCONNECT_ValidateSubform.Requery
End Sub
and this is the BuildFilter code.
Code:
Private Function BuildFilter() As Variant
Dim varWhere As Variant
varWhere = Null ' Main filter
' Check for LIKE First Name
If Me.Text30 > "" Then
varWhere = varWhere & "[SR_Number] LIKE In('*" & Me.Text30 & "*')"
End If
If Me.Text34 > "" Then
varWhere = varWhere & "[Emboss_Name] LIKE ""*" & Me.Text34 & "*"" AND "
End If
' Check if there is a filter to return...
If IsNull(varWhere) Then
varWhere = ""
Else
varWhere = "WHERE " & varWhere
' strip off last "AND" in the filter
If Right(varWhere, 5) = " AND " Then
varWhere = Left(varWhere, Len(varWhere) - 5)
End If
End If
BuildFilter = varWhere
End Function
as you can see. I just put In() on the code because I read that I can you IN() so I can search using/separating comma.
I don't know if I'm doing this right but please help me. This one will be pass tomorrow 
Thank you in advanced..