Option Query Filtering

C

Charles

I have a Form that generates a set of reports. All of these reports are
based on the data for every client. On the form, I would like to add a
feature that would ask the user to input a single client name to filter on.
If the user ran the report without entering anything, the usual reports would
be generated. However, if the user entered a name, a filter would be added
to the lowest level query and the new reports would be calculated off of the
limited data.

I understand how to make the filter work, but I do not know the trick to get
no filtering to occur if no data is entered.

Thanks for any help,
 
H

happywitchie

Charles

How do you get your filter to work? I have a similar problem I am trying to
solve but I can't get my query to filter on a single client name.

hw
 
C

Charles

On my form, I have two lists. The first one is labeled "Filter?" and
contains the values Yes and No. The second list is a list of clients sorted
by volume in decending order. The idea I had was that if the user selected
the No value, there would be no filtering in the queries that generate the
reports. If the user selected the Yes value, the report would be filtered to
only the company selected in the second list. In my basic query, I use as
the criteria for the client column the expression =IIf([Forms]![Monthly
Reports Form]![FilterOption]="Yes",[Forms]![Monthly Reports
Form]![SelectClient]). This works when Yes is selected, but it doesn't
return any results if No is selected. I do not know what sort of command
would need to go in the else parameter of the IIF function.

Charles
 
Top