Re: not display report header when fields are empty

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



chuck wrote:

I have a report which uses three levels of grouping. The form layout looks
something like this:

PageHeader
[table1col1]
GroupHeader1
[table2col1]
[table2col2]
GroupHeader2
[table3col1]
[table3col2]
GroupHeader3
[table4col1]
[table4col2]

The record source of the report is actually a query which joins the values
of 4 different tables. Each GroupHeader in the report contains values from
one of those tables. For a particular record, if a top level header
contains no data, then a lower level header will be empty also.

Everything works fine excepts that when a particular group's records are
empty or null, i don't want the controls to display.

For example, here is a typical report for one of the records for the
"Galaxy" table.

Galaxy: MilkyWay --------------PageHeader
Star System: Solar system ------GroupHeader1
Planet: Earth ----------------GroupHeader2
Satellite: Moon ----------GroupHeader3
Planet: Saturn
Satellite: Mimas
Satellite: Tethys
Satellite: Dione
Satellite: Titan
Planet: Mercury
Satellite:
Star System: otherstarsystem
Planet:
Satellite:

I want the report to look like this, without the labels showing up when
there are no records in that group, and preferably without the headers
taking up any vertical space

Galaxy: MilkyWay
Star System: Solar system
Planet: Earth
Satellite: Moon
Planet: Saturn
Satellite: Mimas
Satellite: Tethys
Satellite: Dione
Satellite: Titan
Planet: Mercury
Star System: otherstarsystem

Is this possible ? Conditional formatting only works on textbox controls and
combobox controls (?) so that won't work. Any other methods someone can
suggest ?


Use the Format event of each section to cancel the event
when the section's significant field is null. For example.
the detail section's Format event:
Cancel = IsNull(Me.Satellite)
Or for the star system group header section:
Cancel = IsNull(Me.Planet)

There is a way to do this without code if your real
situation is as trivial as your example, but the code is
very simple and more general.

--
Marsh
MVP [MS Access]
.



Relevant Pages

  • not display report header when fields are empty
    ... I have a report which uses three levels of grouping. ... Satellite: Tethys ... Planet: Mercury ... Star System: otherstarsystem ...
    (microsoft.public.access.reports)
  • Re: not display report header when fields are empty
    ... then a lower level header will be empty also. ... Satellite: Tethys ... Planet: Mercury ... Star System: otherstarsystem ...
    (microsoft.public.access.reports)
  • Risks Digest 26.60
    ... ACM FORUM ON RISKS TO THE PUBLIC IN COMPUTERS AND RELATED SYSTEMS ... Massive Internet Outage blamed on Juniper routers ... NASA Confirms 'Suspicious Events' in Satellite Hacking Report ...
    (comp.risks)
  • Spysats: win some, lose some
    ... By Michael Fabey/ Aerospace Daily & Defense Report ... Commercial satellite imaging company GeoEye is on schedule to meet the ... GeoEye vice president of communications and marketing. ...
    (sci.space.policy)
  • SwRI Researchers Offer First Explanation for Near Constant Scale of the Gas Planet Satellite Systems
    ... While individual satellite properties vary, ... compared to the mass of its host planet is very nearly a constant ... and why the satellites of gas planets ... the total mass in both satellite systems is about ...
    (sci.space.news)