Hello,
I am in the process of creating a simple database that has a table of data, a query that filters, and a form that searches through the records based on the filters in the query. What I have so far is three combo boxes in the form that I would like to be able to search from. However, the results of data only show up when I make a selection from only one combo box. I would like to be able to search using all three combo boxes that filter based off of each other. Basically - if I select a location in the first combo box, a city in the second combo box, and a category in the third - I want the results to apply all three selections instead of only using the first one to display results.
Here is the SQL of the query:
Please let me know if you have any suggestions/help, I appreciate it very much.
I am in the process of creating a simple database that has a table of data, a query that filters, and a form that searches through the records based on the filters in the query. What I have so far is three combo boxes in the form that I would like to be able to search from. However, the results of data only show up when I make a selection from only one combo box. I would like to be able to search using all three combo boxes that filter based off of each other. Basically - if I select a location in the first combo box, a city in the second combo box, and a category in the third - I want the results to apply all three selections instead of only using the first one to display results.
Here is the SQL of the query:
SELECT DISTINCT tMediaContacts.[City ], tMediaContacts.[Publication Location], tMediaContacts.[Category type], *
FROM tMediaContacts
WHERE (((tMediaContacts.[City ])=[Forms]![fSearch]![cmbCity]) AND ((tMediaContacts.[Publication Location])=[Forms]![fSearch]![cmbLocation])) OR (((tMediaContacts.[Publication Location])=[Forms]![fSearch]![cmbLocation]) AND ((IsNull([Forms]![fSearch]![cmbCity]))<>False)) OR (((tMediaContacts.[City ])=[Forms]![fSearch]![cmbCity]) AND ((IsNull([Forms]![fSearch]![cmbLocation]))<>False)) OR (((tMediaContacts.[City ])=[Forms]![fSearch]![cmbCity]) AND ((tMediaContacts.[Category type])=[Forms]![fSearch]![cmbCategory]) AND ((IsNull([Forms]![fSearch]![cmbLocation]))<>False) AND ((IsNull([Forms]![fSearch]![cmbCategory]))<>False)) OR (((tMediaContacts.[Category type])=[Forms]![fSearch]![cmbCategory]) AND ((IsNull([Forms]![fSearch]![cmbCity]))<>False) AND ((IsNull([Forms]![fSearch]![cmbLocation]))<>False)) OR (((IsNull([Forms]![fSearch]![cmbCity]))<>False) AND ((IsNull([Forms]![fSearch]![cmbLocation]))<>False) AND ((IsNull([Forms]![fSearch]![cmbCategory]))<>False));
Please let me know if you have any suggestions/help, I appreciate it very much.