Report With Sub-Report

  • Thread starter Thread starter Xcelsoft
  • Start date Start date
X

Xcelsoft

I have a report with a sub report and I would like to
control whether or not certain controls on the main
report are visible if there are no detail records in the
sub-report.

Any help will be appreciated.

Thanks
 
Xcelsoft said:
I have a report with a sub report and I would like to
control whether or not certain controls on the main
report are visible if there are no detail records in the
sub-report.


You can check the subreport's HasData property:

Dim bolHasRecords As Boolean
bolHasRecords = Me.subreportcontrol.Report.HasData
Me.textboxA.Visible = bolHasRecords
Me.textboxB.Visible = bolHasRecords
Me.textboxC.Visible = Not bolHasRecords
 
Back
Top