BIBD
BIBD

Reputation: 15394

How can I hide a sub-report that has no records

I have a sub report on another report that could have no records in it. Is there a way I can hide the report (and its label) when there are no records to display?

Alternately, is there a way to return a single row (e.g., "None") when an SQL re-query returns no rows?

Upvotes: 3

Views: 606

Answers (1)

Fionnuala
Fionnuala

Reputation: 91366

There is a HasData property:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.MySubreport.Visible = Me.MySubreport.Report.HasData
End Sub

Upvotes: 4

Related Questions