Link to home
Start Free TrialLog in
Avatar of nfstrong
nfstrongFlag for United States of America

asked on

Display label when subreport empty

I have a report that contains a subreport.  When the subreport does not have any data to display I would like a label to appear with a message saying "No New Clients".  I have the label on the subreport with the visible property set to false.  I also have the below code.  This works when I run the subreport separately, but when I run it with the main report it does not work.  Any suggestions?
Private Sub Report_NoData(Cancel As Integer)
    Me.lblNNC.Visible = True
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland 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 thenelson
thenelson

Put the label on the main report behind the subreport and use this code:
Private Sub Report_NoData(Cancel As Integer)
    Me.Parent.lblNNC.Visible = True
    Me.Visible = False
End Sub