kevinnaomi
IS-IT--Management
I have created a form that has combo boxes for several columns in a table. I have also created a query that selects the records that have the selected four combo boxes values:
SELECT *
FROM costs
WHERE
(((costs.Category)=[Forms]![Search Form]![Category]) AND ((costs.Action)=[Forms]![Search Form]![Action]) AND
((costs.Type)=[Forms]![Search Form]![Type]) AND
((costs.[Sub Type])=[Forms]![Search Form]![Sub Type]));
I was wondering if anyone knows how to change this so that I can select any number of the boxes and the query will still work. I would like to be able to get results from one or two or three columns, as well as all four. If anyone could help, it would be greatly appreciated.
SELECT *
FROM costs
WHERE
(((costs.Category)=[Forms]![Search Form]![Category]) AND ((costs.Action)=[Forms]![Search Form]![Action]) AND
((costs.Type)=[Forms]![Search Form]![Type]) AND
((costs.[Sub Type])=[Forms]![Search Form]![Sub Type]));
I was wondering if anyone knows how to change this so that I can select any number of the boxes and the query will still work. I would like to be able to get results from one or two or three columns, as well as all four. If anyone could help, it would be greatly appreciated.