Question abt sub report on MAIN report!

  • Thread starter Thread starter Earl.AKA J.Alladien in access forum!!
  • Start date Start date
E

Earl.AKA J.Alladien in access forum!!

Hello All,

I use a SUM VALUE from my sub-report on my main-report,and the problem is
that when there is no data in my sub-report I get an ugly #ERROR ,when infact
I just want it to display "0" on no data!
I know this is possible,cause Ive seen it somewhere,but as always you can
never find it when you really need it!
Thanks in advance!
 
Generally you want to use the HasData property of the subreport with IIf()
=IIf(sbrptCtrlName.Report.HasData, sbrptCtrlName.Report!txtFrmSub, 0)
 
Hi Duane,

Thanks for helping me ,I think I am doing something wrong,

My Main rpt name is "COMM-RPT" ,my subrpt "RT" and the sum value( which is
in my subrpt) is "RTCM" ,how do I fill them in in the function you sent me
and where do I put this function? in the Main rpt or in the sub rpt?
Thanks in advance!
 
Assuming the name property of your subreport control on your main report is
"RT" and the name property of the text box in the footer of your subreport is
"RTCM" your expression would be:
=IIf(RT.Report.HasData, RT.Report.RTCM, 0)
 
Back
Top