Sub-Report with No Records

M

Martin

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

George Nicholson

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,
 
M

Martin

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,
 

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