Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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!
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page