Answered by:
Query with multiple inputs

Question
-
Ok, I have another question about queries that I could not find a solution too. Here is what I am trying to do
I work in a lab and am collecting data from many different samples, with different analysis conducted on them. What I want to be able to do is something of the following, if possible.
Have the user select one or more sample types,
Different extraction method,
Solvent types,
Are a few of the items I wish the user to be able to select.
Is it possible to return from a query form multiple items to search for?
For example I'd like to be able to search for;
Whole Potatoes, or Whole Potatoes and Potato Peels
Thanks again,
Justin
Thursday, June 9, 2016 2:37 PM
Answers
-
I figured it out, at least a way to do it. I'm wondering if there is a more efficient way? Here is what I did;
In the criteria on my query I have the following expression,
IIf([Forms]![Navigation Form]![NavigationSubform]![WPR],"Whole Potato - Russet","") Or
IIf([Forms]![Navigation Form]![NavigationSubform]![PPR],"Potato Peel - Russet","")
I don't see this being an issue for only two options, but there is going to be a lot more then two.
- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Monday, June 13, 2016 7:57 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Monday, June 13, 2016 7:57 AM
Friday, June 10, 2016 7:55 PM
All replies
-
Hi Jwis86,
yes it is possible to find multiple items in query.
Following is the example of it.
SELECT * from rptdata where result=10 or result=20 or result=30 and did=3;
for that you have to use "And" and "Or" operators in your query.
please visit the link below for more information.
Queries V: Use And, Or, and In to set multiple conditions
Use the OR criteria to query on alternate or multiple conditions
Hope this will help you to solve your issue.
if you think that the suggestion solved your issue then I would recommend you to mark the suggestion as an answer.
if you still facing an issue regarding that then please let us know so that we can provide you a further help.
Regards
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
- Edited by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, June 10, 2016 2:10 AM
Friday, June 10, 2016 2:09 AM -
Thanks for the response.
This is somewhat clearing it up. But I haven't got quite what I am trying to do work.
I have two different extraction methods; ASE and Soxhlet. Can I go about having a checkbox, one for each and having that submit to the query?
Friday, June 10, 2016 3:51 PM -
I figured it out, at least a way to do it. I'm wondering if there is a more efficient way? Here is what I did;
In the criteria on my query I have the following expression,
IIf([Forms]![Navigation Form]![NavigationSubform]![WPR],"Whole Potato - Russet","") Or
IIf([Forms]![Navigation Form]![NavigationSubform]![PPR],"Potato Peel - Russet","")
I don't see this being an issue for only two options, but there is going to be a lot more then two.
- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Monday, June 13, 2016 7:57 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Monday, June 13, 2016 7:57 AM
Friday, June 10, 2016 7:55 PM -
Hi Jwis86,
its good to hear from you that you got a solution for your issue.
Thanks for sharing the solution with our community so that if other member have same issue like you also get solution by your post.
in your last post you had asked a question that you can use check box or not. here I want to tell you that yes you can use check box. for that you have create a form. in that form you can put your checkboxes. and you have to put Button on form. on the click event of the button the parameters for the query are taken from the checkbox and pass to query and query will execute.
Regards
Deepak
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Monday, June 13, 2016 7:57 AM