Good evening,
I have a form which contains a combox to select certain products. I use the combobox to fill in the form. This combobox is based on a qry with approx 50 records.
Now, I wanted to make a search box in the form which can be used to filter the combobox so I don't have to scroll all the way and look for the product.
Therefore, I have created a text box with button and placed the below vba code on the clicking event".
However, when I do this the combobox gets empty.
When I for example make a seperate QRY as example and put the Me.txtProductChooser.RowSource directly to the saved QRY it shows exactly what I want.
Can somebody explain to me what is going wrong? If additional information is needed, please let me know
Already many thanks!
I have a form which contains a combox to select certain products. I use the combobox to fill in the form. This combobox is based on a qry with approx 50 records.
Now, I wanted to make a search box in the form which can be used to filter the combobox so I don't have to scroll all the way and look for the product.
Therefore, I have created a text box with button and placed the below vba code on the clicking event".
Code:
Private Sub btnSearch_Click()
Dim SQL As String
SQL = "SELECT qryProductChooser.ProdID, qryProductChooser.[Productname], qryProductChooser.Category FROM qryProductChooser" _
& "WHERE Category LIKE '*" & Me.txtKeywords & "*' "
Me.txtProductChooser.RowSourceType = "table/Query"
Me.txtProductChooser.RowSource = "SQL"
Me.txtProductChooser.Requery
End Sub
However, when I do this the combobox gets empty.
When I for example make a seperate QRY as example and put the Me.txtProductChooser.RowSource directly to the saved QRY it shows exactly what I want.
Can somebody explain to me what is going wrong? If additional information is needed, please let me know
