P
Phantom_guitarist
I have a form with a text box where a user can enter a word. The
application then searches a table for any occurence of that word in the
description field. This works ok for single words, but I wish for the user
to be able to enter several words and the query uses 'OR' logic to find
these words.
Currently the SQL is:
SELECT tblStock.ID, tblStock.[Part Number], tblStock.[Product Description],
tblStock.[Unit Cost], tblStock.Quantity
FROM tblStock
WHERE (((tblStock.[Product Description]) Like "*"+[searchkeyword]+"*"));
where [searchword] is the text box on the form. I thought about trying to
use the Replace function to replace the spaces with SQL but it got a little
comlicated and it ended up with several errors and it was too difficult to
debug.
If anyone could suggest a way around this I would be very gratefull.
Stefan
application then searches a table for any occurence of that word in the
description field. This works ok for single words, but I wish for the user
to be able to enter several words and the query uses 'OR' logic to find
these words.
Currently the SQL is:
SELECT tblStock.ID, tblStock.[Part Number], tblStock.[Product Description],
tblStock.[Unit Cost], tblStock.Quantity
FROM tblStock
WHERE (((tblStock.[Product Description]) Like "*"+[searchkeyword]+"*"));
where [searchword] is the text box on the form. I thought about trying to
use the Replace function to replace the spaces with SQL but it got a little
comlicated and it ended up with several errors and it was too difficult to
debug.
If anyone could suggest a way around this I would be very gratefull.
Stefan