misuser2k7
MIS
I have a table which I am trying to query with multiple criteria. The table which has other columns has 3 that are of interest. These 3 criteria on the 3 columns come from 3 combo boxes on a form. The 3 columns of interest are SurveyName, SurveySubject And SurveyResult and they are in a table called ‘Surveys’. The other columns contain other details of surveys. I created an Access query in which I referenced the combo boxes are the sources of the criteria. What the query is supposed to do is find the rows where all 3 criteria are exclusively true. For example, When a survey name is selected from the survey name combo box along with a survey subject and/or survey result from their respective combo boxes, only the rows where are 3 criteria are being answered should be displayed in the output but this not happening. What is happening is that all rows where what was entered as the 3 criteria are mentioned are displayed. What this means is that if I only make a selection in 2 combo boxes leaving the third empty, the result displayed contains all the results of the 2nd criteria with all results for the 1st criteria. SurveyName has particulars like CustSpend, CustSatisf, CustRetBiz and so on. SurveySubject has CustPurchEncounter, CustOrdDelivery, CustReturns and so on. SurveyResult has positive, negative, neutral. So if the user wanted to know about customer survey responses for Customer Spending survey about purchase encounter, the user should see only survey results for CustSpend and CustPurchEncounter regardless of SurveyResult. Instead what is happening is that all rows with CustSpend are displayed with all rows with CustPurchEncounter i.e. the other two criteria are ignored.
I tried entering the 3 criteria with both the ‘And’ and ‘Or’ options in different combinations of the ‘criteria’ and ‘or’ rows in the Access query design view. Putting the criteria on the same row (‘and’ option) resulted in no rows being displayed and putting them on different rows (‘or’ option) displays the result in the manner mentioned above.
Is there a way of writing a query that will result in only displaying rows when the 3 criteria are met strictly even if one or two combo boxes are left empty by the user i.e. the user may just us/enter two criteria instead of all 3?
Thank you all for your help.