Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report with multiple subreports totaling problem

Status
Not open for further replies.

mxfrail

MIS
Jul 7, 2008
25
0
0
US
Ok ...

I have a bunch of subreports each presenting different data.

It goes by sales report with different categories.

Lets say I am trying to total for each rep Cat A and Cat B.

Each rep might not have any data returned in the subreport for one or the other. So I was trying to do the following -

=IIf([qryMarcCTRPRev subreport].[Report]![Jan]>"1",[qryMarcCTRPRev subreport].[Report]![Jan]+[Jan],[Jan])

This works but ... condition is false it does not populate [jan] into the total. Instead it puts #error.

Any thoughts on a better way to write this? Basically I want to search if a value exists in the subreport for that rep. If it does add them together. If not just use the first value.
 
I briefly looked at the link and here is a slight workaround I tried but still problems using HasData -

=IIf([qryMarcCTRPVol subreport].[Report].[HasData]=True,[qryMarcCTRPVol subreport].[Report]![Jan]+[qryMarcCTVol subreport].[Report]![Jan],[qryMarcCTVol subreport].[Report]![Jan])

If my data is this -

1 1 1 1 1 1 1 1 1 = qryMarcCTVol subreport
1 1 1 1 1 1 1 1 1 = qryMarcCTRPVol subreport

results -

2 2 2 2 2 2 2 2 2

If my dats is like this -
1 1 1 1 1 1 = qryMarcCTVol subreport
1 2 2 1 = qryMarcCTRPVol subreport

Results

2 1 2 1 1 1

If my second column has data in it but the corrseponding record in qryMarcCTVol subreport does not it returns nothing.

?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top