Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

In report, how to have a count return something other than null

Discussion in 'Information Technology' started by Heidi, Nov 9, 2005.

  1. Heidi

    Heidi
    Expand Collapse
    Guest

    I have a subreport that holds a count of names at the end of the report that
    I want to reference in the main report to add it. My problem is that
    sometimes this subreport ends up being null - there aren't always entries.
    Can i have the count give a value of zero if it is null so it doesn't give me
    that #Error and screw up my counts in the main form? I tried nz, and iif
    statment, etc but can't seem to make anything work.

    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    Fake encounter: Inquiry report missing from High Court Hard Talk Aug 21, 2010
    UK British Sikh Report-2016 Breaking News Mar 24, 2016
    1984 The Story I Did Not Report In ’84 History of Sikhism Jun 28, 2015
    Opinion Top Green Beret Officer Forced to Resign Over Affair With WaPo Reporter Breaking News Jun 26, 2014
    United Sikhs New Report Shows Increasing Hate Attacks on Sikhs Sikh Organisations May 21, 2014

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    When there are no records in the subreport, nothing shows, and so trying to
    refer to the non-existent text box generates #Error.

    To avoid that, test the HasData property of the report in the subreport
    control:
    =IIf([Sub1].[Report].[HasData], Nz([Sub1].[Report]![Text0],0), 0)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Heidi" <Heidi@discussions.microsoft.com> wrote in message
    news:D8628258-31C4-4D93-8592-49E074824ADF@microsoft.com...
    >I have a subreport that holds a count of names at the end of the report
    >that
    > I want to reference in the main report to add it. My problem is that
    > sometimes this subreport ends up being null - there aren't always entries.
    > Can i have the count give a value of zero if it is null so it doesn't give
    > me
    > that #Error and screw up my counts in the main form? I tried nz, and iif
    > statment, etc but can't seem to make anything work.
    >
    > Thanks!
     

Share This Page