Link to home
Start Free TrialLog in
Avatar of Lawrence Salvucci
Lawrence SalvucciFlag for United States of America

asked on

Display label on subreport when NO DATA on subreport

I am confused on how to set this up. I have a main report that has 3 subreports. There is one subreport that may not have any data at all. So I added a label that has the visible property set to "No". This label sits across all the text fields on this subreport but in an invisible state when the report is opened and has data. What I need to do is have this label become visible ONLY IF this subreport has no data. How can I set this up from the main report to toggle this subreport label to visible when no data and not visible when there is data?

The main report is called: rptDailyShippersMovement
The subreport is called: srptShippersInvoicedDetail
The label on the subreport is called: lblNoInvoiceNotice
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lawrence Salvucci

ASKER

Is the textbox supposed to be in the detail section of the subreport that may or may not have any data?

I tried the OnFormat event but it kept giving me an error that it could not find the label control. The label control is on the subreport. Can I have this label/textbox on the parent report and then have the subreport only be visible IF there is data on it? And then show the label/textbox on the parent report when the subreport isn't visible?
I got it working. Here's what I did on the parent form. Thank you for the idea to do it this way.

    If Me.srptShippersInvoicedDetail.Report.HasData = False Then
        Me.lblNoInvoiceNotice.visible = True
    Else
        Me.lblNoInvoiceNotice.visible = False
    End If

Open in new window

Good deal.  Sorry I wasn't clear that this went on the main report.

Jim.