gojets1721
Registered User.
- Local time
- Today, 07:37
- Joined
- Jun 11, 2019
- Messages
- 430
I have an unbound form to filter a report. One of the unbound fields lets the user enter a customer last name to filter down to records.
I want it so the user can enter multiple names, separated by a semi colon, and pull up records with either last name. The below code works fine if the user enters only one name, but once you enter two or more, no records show (even though there are matching records).
If i type in Johnson;Smith into the textbox, debug.print shows this:
Any suggestions on how to fix? I can post the full code or an example DB if needed
Thanks
I want it so the user can enter multiple names, separated by a semi colon, and pull up records with either last name. The below code works fine if the user enters only one name, but once you enter two or more, no records show (even though there are matching records).
Code:
With Me.txtCustomerLastName
If Len(.Value) > 0 Then
strCriteria = strCriteria & " AND [CustomerLastName] IN ('" & Replace(.Value, ";", ",") & "')"
End If
End With
If i type in Johnson;Smith into the textbox, debug.print shows this:
Code:
strCriteria: " [CustomerLastName] IN ('johnson,smith')"
Any suggestions on how to fix? I can post the full code or an example DB if needed
Thanks