B
Brian
I'm struggling a little with finding a good method to pass a filter to a
report where the field to which the filter applies is not the basis of a
group in the report. That is, I want to FILTER a report by some combination
of customer, item, and date (i.e. user-selectable--any or all of these may be
used as filters concurrently); however, I want to GROUP the report by
customer only and show just the item count within the item & date range.
If I make the report's RecordSource a query that includes summary functions
(i.e. Sum of ItemCount) and send through the Where clause in the OpenReport
method, it chokes on the fact that one or more elements in the Where clause
does not appear in the RecordSource except as another Where (e.g. Where Not
IsNull(ItemID)).
I cannot use Me.Filter for the same reason: if the field appears in a
summarized query, it must be grouped by that field; I cannot just make the
field an Expression.
report where the field to which the filter applies is not the basis of a
group in the report. That is, I want to FILTER a report by some combination
of customer, item, and date (i.e. user-selectable--any or all of these may be
used as filters concurrently); however, I want to GROUP the report by
customer only and show just the item count within the item & date range.
If I make the report's RecordSource a query that includes summary functions
(i.e. Sum of ItemCount) and send through the Where clause in the OpenReport
method, it chokes on the fact that one or more elements in the Where clause
does not appear in the RecordSource except as another Where (e.g. Where Not
IsNull(ItemID)).
I cannot use Me.Filter for the same reason: if the field appears in a
summarized query, it must be grouped by that field; I cannot just make the
field an Expression.