Re: subreport and null value problem

From: tony (anonymous_at_discussions.microsoft.com)
Date: 04/28/04


Date: Wed, 28 Apr 2004 08:13:09 -0700

Marsh,

I tried your suggestion below, but am a little confused
about the label control. When I go to the properties
dialog box for the label, there are no places to enter
events or control source. Where should I place the code

Me.thelabel.Visible = Not Me.subreport.Report.HasData

and/or how do I attach that code to the label?

I appreciate the help.

Tony

>-----Original Message-----
>Tony wrote:
>
>>I am having the problem: I have a "Count(*)" function
in
>>the footer of a report, and within the function I've
>>included the "Nz[field],0" operator to show the 0 when
no
>>records are present. When the report is viewed stand-
>>alone, it prints out fine. However, when it is included
>>as a subreport in another main report, it disappears
when
>>the value is 0. How can I get that subreport to show up
>>even if the value is 0?
>
>
>A subreport with no records does not have any values, not
>even Null. You can, however test if the subreport has
data
>or not and use that to make a control on the main report
>visible of not. For example, if you have a label control
>with the caption 0 on the main report in the same place as
>the subreport control, then you can use a line of code:
>
> Me.thelabel.Visible = Not
Me.subreport.Report.HasData
>
>to display the zero when there is nothing in the
subreport.
>--
>Marsh
>MVP [MS Access]
>.
>



Relevant Pages

  • RE: *REPOST* If then Else Statment in Report
    ... "Duane Hookom" wrote: ... when a main report doesn't return records. ... Earlier as we found I was confused about the name of the control ... which is the name of the subreport as seen in the database window. ...
    (microsoft.public.access.reports)
  • RE: *REPOST* If then Else Statment in Report
    ... Earlier as we found I was confused about the name of the control ... with my report controls. ... "Duane Hookom" wrote: ... which is the name of the subreport as seen in the database window. ...
    (microsoft.public.access.reports)
  • RE: *REPOST* If then Else Statment in Report
    ... A subreport is a container control on a main report. ... "Duane Hookom" wrote: ...
    (microsoft.public.access.reports)
  • RE: Errors in Report total fields
    ... subtotal control ... Are PaymentTotal and ExpenseTotal in the REPORT footer of each subreport? ... reports to get their totals data from the fields of the report which come ...
    (microsoft.public.access.reports)
  • Re: Counting and totaling from a subreport
    ... text box that displays the subreport total. ... report grand total calculation. ... subreport's footer and that the total does not appear on the ... box names and their control source. ...
    (microsoft.public.access.reports)