M
Mishanya
My Subform1 is based on qryPayments and presents the Mainform's selected
client' payments sorted by dates. It's Record Source:
SELECT [qryPayments].ClientID, [qryPayments].Payment,
[qryPayments].CurrencyID, [qryPayments].Date
FROM [qryPayments]
ORDER BY [qryPayments].Date;
The Mainform has unbound cboDateRange based on tblDateRanges consisting of
date-range' values ("Between Date() And DateAdd("m",1,Date())" etc.). It
applies on the Subform1 with AfterUpdate event:
Dim F As Form
Set F = Forms![Mainform]![Subform1].Form
F.Filter = "[qryPayments].Date" & Me.cboDateRange.Column(2)
F.FilterOn = True
My Subform2 presents the same info only it summarizes the payments for each
currency. It's Record Source is:
SELECT [qryPayments].ClientID, Sum([qryPayments].Payment) AS SumOfPayments,
[qryPayments].CurrencyID
FROM [qryPayments]
GROUP BY [qryPayments].ClientID, [qryPayments].CurrencyID;
I want to apply the same filter on the Subform2 as well, but it means
including the field Date in the latter' underlying query, wich breaks the
grouping by currency (presents as many rows for each currency as dates
listed). I've tried to avoid it by setting Where instead of Group By in the
Date' Total row, but got error msg "Can't display the field with Where in the
Total row". I can uncheck the Show check box and still use the Date field
with manual criteria (it will apply the criteria even without showing the
field), but when applying cboDateRange, it won't find the field Date.
How can I apply the daterange filter while presenting the data grouped only
by Currency?
client' payments sorted by dates. It's Record Source:
SELECT [qryPayments].ClientID, [qryPayments].Payment,
[qryPayments].CurrencyID, [qryPayments].Date
FROM [qryPayments]
ORDER BY [qryPayments].Date;
The Mainform has unbound cboDateRange based on tblDateRanges consisting of
date-range' values ("Between Date() And DateAdd("m",1,Date())" etc.). It
applies on the Subform1 with AfterUpdate event:
Dim F As Form
Set F = Forms![Mainform]![Subform1].Form
F.Filter = "[qryPayments].Date" & Me.cboDateRange.Column(2)
F.FilterOn = True
My Subform2 presents the same info only it summarizes the payments for each
currency. It's Record Source is:
SELECT [qryPayments].ClientID, Sum([qryPayments].Payment) AS SumOfPayments,
[qryPayments].CurrencyID
FROM [qryPayments]
GROUP BY [qryPayments].ClientID, [qryPayments].CurrencyID;
I want to apply the same filter on the Subform2 as well, but it means
including the field Date in the latter' underlying query, wich breaks the
grouping by currency (presents as many rows for each currency as dates
listed). I've tried to avoid it by setting Where instead of Group By in the
Date' Total row, but got error msg "Can't display the field with Where in the
Total row". I can uncheck the Show check box and still use the Date field
with manual criteria (it will apply the criteria even without showing the
field), but when applying cboDateRange, it won't find the field Date.
How can I apply the daterange filter while presenting the data grouped only
by Currency?