Ms Access Rpt Change prior detail line format

P

PE

How may I CHANGE the format of the Detail line 1 in a report if Line 2 is missing values but the rest of the detail lines after that have values.

I have a report with 60 detail lines for specific areas. the first line is the total for all, the second line is the total for area XX the third line is the total for area YY. Then the rest are individual accounts for the XX and YY areas

If Area XX is missing I want the format of the first line with the totals to be formatted differently than if all areas had values.

AREA p1 p2 p3
TOT 123 232 222
XX na na na
YY 123 232 222

I want TOT to also now have na na

Thanks
PE



EggHeadCafe - Software Developer Portal of Choice
Dynamically Create Printer Friendly Pages
http://www.eggheadcafe.com/tutorial...8-d797ee4dbf0f/dynamically-create-printe.aspx
 
K

KARL DEWEY

If Area XX is missing I want the format of the first line with the totals
to be formatted differently than if all areas had values.
You did not say what the different format should look like.

Post you query SQL feeding this report.
 
K

KARL DEWEY

Maybe a union query like this --
SELECT Null AS Field1,Null AS Fiwld2, "TOT" AS Area, Sum(tbl_PE.P1) AS P1_,
Sum(tbl_PE.P2) AS P2_, Sum(tbl_PE.P3) AS P3_
FROM tbl_PE
GROUP BY Field1, Field2, "TOT"
UNION ALL SELECT Null AS Field1,Null AS Field2, Area, IIF(Sum(tbl_PE.P1)
= 0,"N/A", Sum(tbl_PE.P1)) AS P1_, IIF(Sum(tbl_PE.P2) = 0, "N/A",
Sum(tbl_PE.P2)) AS P2_, IIF(Sum(tbl_PE.P3) = 0, "N/A", Sum(tbl_PE.P3)) AS P3_
FROM tbl_PE
GROUP BY Field1, Field2, AREA
UNION ALL SELECT Field1, Field2, AREA, P1 AS P1_, P2 AS P2_, P3 AS P3_
FROM tbl_PE;
 
Top