Subreport On No Data event

  • Thread starter lmcc via AccessMonster.com
  • Start date
L

lmcc via AccessMonster.com

I have a report with a subreport. Sometimes the subreport has data and
sometimes it does not.

If the subreport has no data, I want the lblAdditionalAddresses label to not
be visible. In the subreport On No Data even I entered the following code:

Reports![rptCompanyProfile]![lblAdditionalAddresses].Visible =
False

It is not working.

How can I get this to work?

Thanks.
 
A

Allen Browne

Right-click the lblAdditionalAddresses, and Change To | Text Box.

Set its Control Source property to:
=IIf([Sub1].[Report].[HasData], "Addresses:", Null)
substituting the name of your subreport for Sub1.
 
L

lmcc via AccessMonster.com

Thanks, that did it!

Allen said:
Right-click the lblAdditionalAddresses, and Change To | Text Box.

Set its Control Source property to:
=IIf([Sub1].[Report].[HasData], "Addresses:", Null)
substituting the name of your subreport for Sub1.
I have a report with a subreport. Sometimes the subreport has data and
sometimes it does not.
[quoted text clipped - 6 lines]
Reports![rptCompanyProfile]![lblAdditionalAddresses].Visible =
False
 

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