Question abt sub report on MAIN report!

  • Thread starter Earl.AKA J.Alladien in access forum!!
  • 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!
 
D

Duane Hookom

Generally you want to use the HasData property of the subreport with IIf()
=IIf(sbrptCtrlName.Report.HasData, sbrptCtrlName.Report!txtFrmSub, 0)
 
E

Earl.AKA J.Alladien in access forum!!

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!
 
D

Duane Hookom

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top