Hi everybody,
I have a report I've created which pulls in query data from two separate queries:
The report is called: rptMonthlyReport
It is bound to the source: qryMonthlyReport
This report allows us to select an employee from a dropdown (cboEmployee) and view all active project records for them. A need was introduced to print completed projects for the month by the same employee.
So, I created a child on the report and bound it to a second query:
Report: rptMonthlyReport
Source: qryMonthlyReport
Child: sbrptCompletedReport
Child Source: qryCompletedReport
All works fine and dandy, but....when I select an employee from cboEmployee, apply the filter, and open the report -- the filter is only applied to the rptMonthlyReport and qryMonthlyReport.
sbrptCompletedReport and qryCompletedReport which are bound to the main report do not apply this filter, so all completed projects for EVERY employee are printed on this subreport.
I tried linking the master and child fields in the property sheet of the subform, but I can't seem to find the right combination of fields to link to give me results where the value in the cboEmployee control matches the [Representative] field both rptMonthlyReport and its subreport rptCompletedReport.
Any ideas how to apply this filter to both the main report and its subreport?
I have a report I've created which pulls in query data from two separate queries:
The report is called: rptMonthlyReport
It is bound to the source: qryMonthlyReport
This report allows us to select an employee from a dropdown (cboEmployee) and view all active project records for them. A need was introduced to print completed projects for the month by the same employee.
So, I created a child on the report and bound it to a second query:
Report: rptMonthlyReport
Source: qryMonthlyReport
Child: sbrptCompletedReport
Child Source: qryCompletedReport
All works fine and dandy, but....when I select an employee from cboEmployee, apply the filter, and open the report -- the filter is only applied to the rptMonthlyReport and qryMonthlyReport.
Code:
If Not IsNull(Me.cboEmployee) Then
ReportFilter = "[Representative] =" & "[Forms]![frmHomeProjects]![cboEmployee]"
End If
DoCmd.OpenReport "rptMonthlyReport", acViewReport, "", ReportFilter, acReadOnly, acNormal
sbrptCompletedReport and qryCompletedReport which are bound to the main report do not apply this filter, so all completed projects for EVERY employee are printed on this subreport.
I tried linking the master and child fields in the property sheet of the subform, but I can't seem to find the right combination of fields to link to give me results where the value in the cboEmployee control matches the [Representative] field both rptMonthlyReport and its subreport rptCompletedReport.
Any ideas how to apply this filter to both the main report and its subreport?