Access Filtering not working

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I have an Access ComboBox1 with the following RowSource and in the t_Manufacturer Change event
I have the code ComboBox1.Requery but for some reason the ComboBox1 list is not filtering according to what I type in the textbox
SELECT t_Manufacturer.Manufacturer, t_Manufacturer.Country FROM t_Manufacturer WHERE (((t_Manufacturer.Manufacturer) Like "*" & [forms
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
do you have a sample can share with us? any error message you have encountered?
Software Team Lead
Commented:
this seems working for me.

Private Sub Combo0_Change()
    Dim SQL As String
    SQL = "SELECT t_Manufacturer.ID, t_Manufacturer.Manufacturer, t_Manufacturer.Country FROM t_Manufacturer WHERE Manufacturer Like '*" & Replace(Combo0.Text, "'", "''") & "*' "
    Combo0.RowSource = SQL
    SendKeys "{F4}"
End Sub

Open in new window

29165316.accdb
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Thanks Ryan. That worked for me

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial