I want to be able to have multiple parameter queries, but the user needs to have the option of entering a parameter or not limiting the output at all. How do I let the user choose "all", or what do they type in so that nothing is excluded?
Astello said:I was hoping there was some way to type in multiple constraints, like an AND statement or something. But so far I've found nothing of the sort, which makes sense. Thanks again for all your help.
Thanks for posting the criteria you used. But there is a limitation in your criteria. InAstello said:By the way, the WHERE statement I came up with for selecting one param or all is this code:
WHERE
((([DataTable].[Division Name])=IIf([Division Name?] Is Null Or [Division Name?]="all",[Division Name],[Division Name?]))
AND (([DataTable].Type)=IIf([Type?] Is Null Or [Type?]="all",[Type],[Type?]))
AND (([DataTable].[Dest ST])=IIf([Destination State?] Is Null Or [Destination State?]="all",[Dest ST],[Destination State?]))
AND (([DataTable].[Dest Zip])=IIf([Destination Zip?] Is Null Or [Destination Zip?]="all",[Dest Zip],[Destination Zip?])));
I used it to select the division, type of transportation, destination city and destination zip from a database with shipping information. This lets the user type in a constraint, or to enter "all" or leave it blank to not restrict the field. For anyone else with this question.
I'm glad it works for you.In the database I'm running, a record with a null value for anything I am pulling would be incomplete and would need to be cut out anyway. This query takes care of that for me.