Main report recordset using a parameter for input 1234*
SELECT * FROM table WHERE JobNumber LIKE "1234*"
Main Report
-----------------------------------
ID Employee JobNumber Hours
-----------------------------------
1 Bob 1234A 8
2 Bob 1234B 4
3 Dan 1234B 7
Linked fields:
Master: JobNumber | Child: JobNumber
Subreport (Aggregate of hours by employee)
Even though the main report has 1234A and 1234B
the subreport will only include one of those in its
total. It won't include both and doesn't ask for
which one to include
-----------------------------------
Employee Hours (Aggregated on A)
-----------------------------------
Bob 8
OR
-----------------------------------
Employee Hours (Aggregated on B)
-----------------------------------
Bob 4
Dan 7
There is also the odd situation where Main Report has no records
but the subreport shows jobs that have an empty string JobNumber
over all the records in the database
Main report recordset using a parameter for input SOME-BAD-NUMBER
SELECT * FROM table WHERE JobNumber LIKE "SOME-BAD-NUMBER"
Main Report
-----------------------------------
ID Employee JobNumber Hours
-----------------------------------
No reults
Subreport
-----------------------------------
Employee Hours (Still shows records)
-----------------------------------
Bob 16
Dan 52
Mark 100
Joe 12
Yes, that is correct. The sub report would should records related to the main report record based on the master/child linking.
<<Why does it show records when the main report doesn't? >>
A few things to check:
a. Make sure you have the sub-report in the detail section of the main report. If you don't, the sub report may be for a different job number.
b. Make sure the master and child and link fields are correct. The master should uniquely identify the main record across the entire report.
To check this, open the Recordsource for the main report. Do you see one record for each job? If not, there's part (or all) of your problem.
Jim.