Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Filters

Status
Not open for further replies.

elsolo21

Programmer
Apr 7, 2008
26
0
0
US
I think I'm either missing a really easy concept or looking at this the wrong way. My problem is that want a filter to be 'optional'. What I'm doing it I'm prompting the user if he wants to use a filter. If Yes is selected, then the data is filtered, if No is selected, then all data (non-filtered) needs to display. In my yes/no prompt, it's very easy to get the 'yes' part to work but I don't know how to shut off the filter or have it include all data if the user selects 'no'

thanks,
-Eric
 
Why are you using a specific yes/no instead of just using an optional filter? The whole purpose of an optional filter is so that if the user skips it they get "all".

If you must have this option I think you still have to make your data parameter optional (otherwise the no won't work). Then have a Yes/No prompt. In your data filter, use something like:

if (paramdisplayvalue('ShouldThisBeFiltered') = 'Yes'
then (Regular Parameterized Filter Goes Here)
else (1=1)

That'll basically say "if they chose the yes option then use the other parameter provided, otherwise just give everything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top