I've got a listbox that requeries after a user chooses a value from a combo box. In my sql statement I'm using LIKE in my WHERE clause because the records have a field with multiple values so I'm needing to search for a string within the field like 'CP'. My question is can I use a variable in the place of the hardcoded value...like 'CP'?
this sql statemenet is what I've been using:
"SELECT * FROM Orders WHERE ERRORCODES = '" & Me.cbxOrderErrors & "'"
can I incorporate a variable or the combobox value like above into this sql statement:
"SELECT * FROM Orders WHERE ERRORCODES LIKE '%CP%'
this sql statemenet is what I've been using:
"SELECT * FROM Orders WHERE ERRORCODES = '" & Me.cbxOrderErrors & "'"
can I incorporate a variable or the combobox value like above into this sql statement:
"SELECT * FROM Orders WHERE ERRORCODES LIKE '%CP%'