Sub-Report with No Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't know all the functions available in Access. I am trying to display a
Label or unbound box (allow to shrink the section) in the Main Report if the
subreport contains no record. The trouble I have is that I don't know how to
set the condition for the SubReport. I tried:

Dim bolShow as Boolean

bolShow = Not( IsNull(Me.MySubReport))

Me.MyNoShowMessage.Visible = bolShow

I think the Me.MySubReport don't return anything

Thanks for the Help!
 
Use the Report.HasData property:
bolShow = Not Me.SubReportControl.Report.HasData

Note: the SubreportControl container *may* have the same name as the report
it holds, but if it doesn't, make sure you use the name of the Control. You
have to use the names of the containers when making references to subreports
& subforms. The names of the forms/reports themselves are useless.

HTH,
 
Thank you. It works like a charm.

George Nicholson said:
Use the Report.HasData property:
bolShow = Not Me.SubReportControl.Report.HasData

Note: the SubreportControl container *may* have the same name as the report
it holds, but if it doesn't, make sure you use the name of the Control. You
have to use the names of the containers when making references to subreports
& subforms. The names of the forms/reports themselves are useless.

HTH,
 
Back
Top