K
Kevin Witty
I have a subreport of a main report which shows invoice payments made and
their allocations to different orders. It should look like this:
Customer
Group1 Header
Rec# Check# CheckDate Amount Allocated
1 1 5/1/04 100,00 100.00
Group 2 Header
1 25.00
Order 1 Detail
2 75.00
Order 9 Detail
3 2 5/3/04 75.00 75.00 Order 5
Group 2 Header
3 75.00
Order 2 Detail
4 3 5/6/04 200.00 150.00
Group 2 Header
4 100.00
Order 92 Detail
5
50.00 Order 177 Detail
6 4 5/6/04 200.00 200.00
Group 2 Header
6 100.00
Order 94 Detail
7 100.00
Order 123 Detail
Total 575.00 525.00
Group 1 Footer
Each record contains the check#, check date, check amount, total allocated
amount, and order allocation. I'm simply supressing the display of the data
in the detail records. I obviously can't use sum(Amount) to get the total
amount, since that would produce the sum of Amount in each record. I can set
report total fields to 0 at the Group 1 Header, but I can't add Group 2
numbers to them at Group 2 Header time because the Group Header might repeat
on a second page. So I thought I could do this at detail format time by
adding them only on the first record of each group 2 set of records.
HOWEVER, this doesn't work.
In the case I'm looking at, record 1 is the last record to appear on a page.
By using debug, I find that Access fires the Detail Format event as follows:
Total Amount
Record 1 25
Record 2 100
Record 1 (again) 125
Record 2 (again) 200
Record 3 275
Record 4 375
Record 5 425
Record 6 525
Record 7 625
Record 2-7 (again) 1125
Can anyone make ANY sense out of this, and tell me how I can get around
it????? Obviously the totals are completely out of whack. I suppose I could
put the details into a sub-report of the sub-report, but that seems
ridiculous. The main report already has two separate subreports, So I'd then
have
Main
Sub
Sub
Sub
Kevin (Hoping these columns don't get completely out of whack in the
formatting here)
their allocations to different orders. It should look like this:
Customer
Group1 Header
Rec# Check# CheckDate Amount Allocated
1 1 5/1/04 100,00 100.00
Group 2 Header
1 25.00
Order 1 Detail
2 75.00
Order 9 Detail
3 2 5/3/04 75.00 75.00 Order 5
Group 2 Header
3 75.00
Order 2 Detail
4 3 5/6/04 200.00 150.00
Group 2 Header
4 100.00
Order 92 Detail
5
50.00 Order 177 Detail
6 4 5/6/04 200.00 200.00
Group 2 Header
6 100.00
Order 94 Detail
7 100.00
Order 123 Detail
Total 575.00 525.00
Group 1 Footer
Each record contains the check#, check date, check amount, total allocated
amount, and order allocation. I'm simply supressing the display of the data
in the detail records. I obviously can't use sum(Amount) to get the total
amount, since that would produce the sum of Amount in each record. I can set
report total fields to 0 at the Group 1 Header, but I can't add Group 2
numbers to them at Group 2 Header time because the Group Header might repeat
on a second page. So I thought I could do this at detail format time by
adding them only on the first record of each group 2 set of records.
HOWEVER, this doesn't work.
In the case I'm looking at, record 1 is the last record to appear on a page.
By using debug, I find that Access fires the Detail Format event as follows:
Total Amount
Record 1 25
Record 2 100
Record 1 (again) 125
Record 2 (again) 200
Record 3 275
Record 4 375
Record 5 425
Record 6 525
Record 7 625
Record 2-7 (again) 1125
Can anyone make ANY sense out of this, and tell me how I can get around
it????? Obviously the totals are completely out of whack. I suppose I could
put the details into a sub-report of the sub-report, but that seems
ridiculous. The main report already has two separate subreports, So I'd then
have
Main
Sub
Sub
Sub
Kevin (Hoping these columns don't get completely out of whack in the
formatting here)