W
Widge
I've got a listbox which is pulling up:
Merchant
Merchant Code
Description
Price
and what I would like to do is have a textbox drive what the listbox
is displaying. Basically I can get the table selection behind the
scenes sorted ok, so I've got a combobox driving where you are
searching "ie Merchant Code/Description", but what I don't know is how
to get the search part of things working.
This is what I have so far :
Private Sub Command13_Click()
If Combo8 = "Description" Then
SQLTab = "AllPrices.Description"
ElseIf Combo8 = "Manufacturer Code" Then
SQLTab = "AllPrices.[Manu Code]"
ElseIf Combo8 = "Merchant Code" Then
SQLTab = "AllPrices.[Product Code]"
End If
List11.RowSource = "SELECT AllProducts.Supplier, AllPrices.
[Product Code], AllPrices.Description, AllPrices.Price, AllPrices.
[Core/Wider] & FROM AllPrices INNER JOIN AllProducts ON AllPrices.
[Product Code] = AllProducts.[Product Code] WHERE " & SQLTab & " Like
'" & Text6 & "'"
Debug.Print List11.RowSource
End Sub
Bit baffled as to why the Like doesn't work. Even when hard coding it
to a *.
Cheers for any help!
Merchant
Merchant Code
Description
Price
and what I would like to do is have a textbox drive what the listbox
is displaying. Basically I can get the table selection behind the
scenes sorted ok, so I've got a combobox driving where you are
searching "ie Merchant Code/Description", but what I don't know is how
to get the search part of things working.
This is what I have so far :
Private Sub Command13_Click()
If Combo8 = "Description" Then
SQLTab = "AllPrices.Description"
ElseIf Combo8 = "Manufacturer Code" Then
SQLTab = "AllPrices.[Manu Code]"
ElseIf Combo8 = "Merchant Code" Then
SQLTab = "AllPrices.[Product Code]"
End If
List11.RowSource = "SELECT AllProducts.Supplier, AllPrices.
[Product Code], AllPrices.Description, AllPrices.Price, AllPrices.
[Core/Wider] & FROM AllPrices INNER JOIN AllProducts ON AllPrices.
[Product Code] = AllProducts.[Product Code] WHERE " & SQLTab & " Like
'" & Text6 & "'"
Debug.Print List11.RowSource
End Sub
Bit baffled as to why the Like doesn't work. Even when hard coding it
to a *.
Cheers for any help!