Dates Range for Report and Subreport

  • Thread starter Thread starter Annelie
  • Start date Start date
A

Annelie

I am trying to create a payroll report for a range of dates. The main report
shows payroll expense by job by code, the sub reports shows in totals the
employee deductions and net pay
The are linked by the field: WEDate.

In the Query, the Wedate has the criteria: Between [Beginning Date] and
[Ending Date].

I somehow have the feeling that the subreport does not associate the
Beginning date and Ending Date as being the linked field. Every thing works
fine as long as I pick one week, but when I select a range of dates, the sub
report show the data for the ending date only.
 
Annelie,

A subreport will show records where *the* value in the linking field
matches the value in the main report's Master linking field. You
won't be able to get it to relate to a range of values. Normally the
Link between a main report and subreport is based on a one-to-many
relationship, which is not the case with your report. One option
would be to use the same criteria for the subreport as you use for the
main report, rahter than relying on the LinkChildFields and
LinkMasterFields to do it for you. But really, on the face of what
you have told us so far, you probably shouldn't even be using a
subreport in this instance. It sounds like you would be better with
one query that returns all the data you want on the report, and then
use the report's Sorting & Grouping to put it in the right place.

- Steve Schapel, Microsoft Access MVP
 
Since this is not something I need to do regularly, perhaps I will print the
subreport by itself using the same date range. I can't see any other way to
relate the 2 sets of data, since I did not save it in a usable format. I
need to think about changing the way I save the data.
Thanks for you help, at least I won't be wasting any more time trying to
accomplish it the way it is right now.
Annelie

Steve Schapel said:
Annelie,

A subreport will show records where *the* value in the linking field
matches the value in the main report's Master linking field. You
won't be able to get it to relate to a range of values. Normally the
Link between a main report and subreport is based on a one-to-many
relationship, which is not the case with your report. One option
would be to use the same criteria for the subreport as you use for the
main report, rahter than relying on the LinkChildFields and
LinkMasterFields to do it for you. But really, on the face of what
you have told us so far, you probably shouldn't even be using a
subreport in this instance. It sounds like you would be better with
one query that returns all the data you want on the report, and then
use the report's Sorting & Grouping to put it in the right place.

- Steve Schapel, Microsoft Access MVP


I am trying to create a payroll report for a range of dates. The main report
shows payroll expense by job by code, the sub reports shows in totals the
employee deductions and net pay
The are linked by the field: WEDate.

In the Query, the Wedate has the criteria: Between [Beginning Date] and
[Ending Date].

I somehow have the feeling that the subreport does not associate the
Beginning date and Ending Date as being the linked field. Every thing works
fine as long as I pick one week, but when I select a range of dates, the sub
report show the data for the ending date only.
 
Back
Top