RE: *REPOST* If then Else Statment in Report
- From: Thorson <Thorson@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Dec 2008 12:06:00 -0800
"SumOfExpr4" Is a field in the query "qryMonthlyReportPG1ORR" that the Main
Report is built on. Expr4 is in a query "qryORRMonthlyDispositionRecords"
before that one, Expr4 is an equation: Expr4:
IIf((tblDispositionRecords!DispMethod="Transferred"),(qryORRMonthlyDispositionRecordsTransferred!Expr3),([Head]))
I just never changed the name of it. "SumOfExpr4" in qryMonthlyReportPG1ORR
sums up the field Expr4 in qryORRmOnthlyDispositionRecords.
Since the "SumOfExpr4" is a field I tried using the IsNull() Formula, but
I'm not quite sure how to set it up. Also as you can see from the orginal
equation the Sum of SumOfExpr4 is added to the subreport Births Total.
I would also like the equation to still add the number of births even if
"SumOfExpr4" is null.
--
Thorson
"Duane Hookom" wrote:
Where is SumOfExpr4 from? Is this a control or field or what? "Expr4".
displays a lack of effort and maintainability.
The HasData property is for reports. A report (or subreport) has this
property. A field or control can be checked for data using IsNull().
--
Duane Hookom
Microsoft Access MVP
"Thorson" wrote:
Someone tried helping me out with this before, but we couldn't get the
equation he suggested to work:
I currently have an if then else statment in my report that adds the sum of
another field to the sum of animal births (if animal births has data). I
would however like this whole equation to=0 if nothing is reported, however
instead it has an #error.
I thought that edited the equation would solve the problem but I'm not sure
how to edit it. This is the orginial eqation:
=(Sum([SumOfExpr4]))+IIf(rptORRMonthlyBirthsCountSubreport.Report.HasData,rptORRMonthlyBirthsCountSubreport.Report.CountOfEarTag,0)
This is what I tried editing it to, and it didn't work:
=IIf((SumOfExpr4.HasData),((Sum([SumOfExpr4]))+IIf(rptORRMonthlyBirthsCountSubreport.Report.HasData,rptORRMonthlyBirthsCountSubreport.Report.CountOfEarTag,0)),0)
--
Thorson
- Follow-Ups:
- RE: *REPOST* If then Else Statment in Report
- From: Duane Hookom
- RE: *REPOST* If then Else Statment in Report
- References:
- *REPOST* If then Else Statment in Report
- From: Thorson
- RE: *REPOST* If then Else Statment in Report
- From: Duane Hookom
- *REPOST* If then Else Statment in Report
- Prev by Date: RE: SumIf on report
- Next by Date: RE: Count records in footer
- Previous by thread: RE: *REPOST* If then Else Statment in Report
- Next by thread: RE: *REPOST* If then Else Statment in Report
- Index(es):
Relevant Pages
|
Loading