Taff
Registered User.
- Local time
- Today, 19:01
- Joined
- Feb 3, 2004
- Messages
- 158
Hi All,
I have a form with A text box, Combo box and List box on. On the OnChange event of the text box I have the following:-
What I would like is to insert another where clause which says that the ContractID from the Products table = Text14 but am really unsure how to do it. My knowledge of the above is very limited and copied the code from another example and tailored it to suit my needs.
Any help would be greatly appreciated.
Many Thanks
Anthony
I have a form with A text box, Combo box and List box on. On the OnChange event of the text box I have the following:-
Code:
Private Sub ProductSearchtxt_Change()
Dim txtSearchString As Variant
Dim strSQL As String
txtSearchString = Me![ProductSearchtxt].Text
strSQL = "SELECT DISTINCTROW [Products].ContractID, [Products].ProductID, [Products].Name, [Products].UnitCost, [Products].Points FROM [Products] "
strSQL = strSQL & "WHERE (([Products]." & Me.Combo6.Column(0) & ") Like '" & txtSearchString & "*')"
strSQL = strSQL & "ORDER BY [Products].ProductID, [Products].Name"
Me!listProducts.RowSource = strSQL
Me!listProducts.Requery
Me!ProductSearchtxt.SetFocus
End Sub
What I would like is to insert another where clause which says that the ContractID from the Products table = Text14 but am really unsure how to do it. My knowledge of the above is very limited and copied the code from another example and tailored it to suit my needs.
Any help would be greatly appreciated.
Many Thanks
Anthony