Subreport On No Data event

Discussion in 'Access VBA Modules' started by lmcc via AccessMonster.com, May 31, 2010.

  1. 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.
     
    lmcc via AccessMonster.com, May 31, 2010
    #1
    1. Advertisements

  2. lmcc via AccessMonster.com

    Allen Browne Guest

    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.
     
    Allen Browne, May 31, 2010
    #2
    1. Advertisements

  3. Thanks, that did it!

     
    lmcc via AccessMonster.com, May 31, 2010
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.