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 - Microsoft MVP. Perth, Western Australia

    Reply to group, rather than allenbrowne at mvps dot org.


    "lmcc via AccessMonster.com" <u59647@uwe> wrote in message
    news:a8cce455d5a21@uwe...
    > 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
     
    Allen Browne, May 31, 2010
    #2
    1. Advertisements

  3. Thanks, that did it!

    Allen Browne wrote:
    >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


    --

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

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.
Similar Threads
  1. SHIPP

    A subreport within a subreport

    SHIPP, Aug 8, 2003, in forum: Access VBA Modules
    Replies:
    1
    Views:
    209
    SHIPP
    Aug 11, 2003
  2. Don

    SubReport

    Don, Aug 13, 2003, in forum: Access VBA Modules
    Replies:
    0
    Views:
    98
  3. DOYLE60

    How to make a no data subreport dissappear

    DOYLE60, Dec 5, 2003, in forum: Access VBA Modules
    Replies:
    7
    Views:
    158
    Marshall Barton
    Dec 9, 2003
  4. Subreport Error

    , Jul 23, 2004, in forum: Access VBA Modules
    Replies:
    0
    Views:
    108
  5. Marv
    Replies:
    5
    Views:
    164
    Alex Dybenko
    Feb 27, 2006
  6. Mona-ABE
    Replies:
    0
    Views:
    160
    Mona-ABE
    Jun 12, 2006
  7. Andy Cap
    Replies:
    4
    Views:
    152
    Andy Cap
    Aug 25, 2006
  8. vauneen

    refer to event procedure subreport

    vauneen, Oct 11, 2006, in forum: Access VBA Modules
    Replies:
    7
    Views:
    166
    Duane Hookom
    Oct 12, 2006
Loading...