Re: subreport and null value problem

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 04/28/04


Date: Wed, 28 Apr 2004 13:36:10 -0500

tony wrote:
>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?

Sorry, I should have said that the code needs to be in the
Format event of the **section** containing the subreport.

The code is not "attached" to the label, it just operates on
the label.

-- 
Marsh
MVP [MS Access]
>>-----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?
>>
>>
>Marshall BArton wrote
>>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.


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: 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)
  • Re: For Marshall Barton
    ... Text Boxes and Control Source. ... Source for the amount of one check was exactly the same as was in the Report ... Report Footer Section: ... Subreport: SubRpt_AExpenses ...
    (microsoft.public.access.reports)