Remove space from group heading

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When user selects option to supress detail section of report (see example
below), I supress the labels in the group heading. I also want to remove the
space in the group heading where the labels appear. The example below works
fine, except that the line " .GroupHeader0.Height = 0.3" does not work. The
normal height for the group heading is .6" and that is what keeps printing.
Please suggest correct solution. Thank you.

Included in Report Open event.
dim a
a = MsgBox("Include detail?", vbYesNo + vbDefaultButton1, "Report
selection")
Me.Detail.Visible = a = vbYes
If Not Me.Detail.Visible Then
With Me
.Line21.Visible = False
.Line22.Visible = False
.Line23.Visible = False
.Line20.Visible = False
.lblProcedure.Visible = False
.lblTotalLabor.Visible = False
.GroupHeader0.Height = 0.3
End With
End If
 
richardb said:
When user selects option to supress detail section of report (see example
below), I supress the labels in the group heading. I also want to remove the
space in the group heading where the labels appear. The example below works
fine, except that the line " .GroupHeader0.Height = 0.3" does not work. The
normal height for the group heading is .6" and that is what keeps printing.
Please suggest correct solution. Thank you.

Included in Report Open event.
dim a
a = MsgBox("Include detail?", vbYesNo + vbDefaultButton1, "Report
selection")
Me.Detail.Visible = a = vbYes
If Not Me.Detail.Visible Then
With Me
.Line21.Visible = False
.Line22.Visible = False
.Line23.Visible = False
.Line20.Visible = False
.lblProcedure.Visible = False
.lblTotalLabor.Visible = False
.GroupHeader0.Height = 0.3
End With
End If


Instead of changing the height of the section, add a text
box (without attached label) with it's height set to .3 and
make it invisible. Then set the header section's CanShrink
property to Yes.
 
Thanks Marshall,

The area I wanted to shrink was where the invisible elements reside. What I
didn't think of was that these elements still existed, and although
invisible, they blocked me from shrinking that area of the header. Solution:
Move these elements out of the way when invisible, then the height adjustment
to the header works. For example:

If Not Me.Detail.Visible Then
With Me
.Line21.Visible = False
.Line21.Top = 0.0417
.Line22.Visible = False
.Line22.Top = 0.0417
.Line23.Visible = False
.Line23.Top = 0.0417
.Line20.Visible = False
.Line20.Top = 0.0417
.lblProcedure.Visible = False
.lblProcedure.Top = 0.0417
.lblTotalLabor.Visible = False
.lblTotalLabor.Top = 0.417
.GroupHeader0.Height = 0.3
End With
End If
 
True (in AXP or later), but it's twice as much code.

The idea of using CanShrink will take care of it too. The
only issue is that making a label or line invisible doesn't
trigger a section's shrinking. However a text box will as
long as everything else in its "horizontal band" is
invisible.
 
Your method worked and it is a very useful technique. Thank you.

Marshall Barton said:
True (in AXP or later), but it's twice as much code.

The idea of using CanShrink will take care of it too. The
only issue is that making a label or line invisible doesn't
trigger a section's shrinking. However a text box will as
long as everything else in its "horizontal band" is
invisible.
--
Marsh
MVP [MS Access]

The area I wanted to shrink was where the invisible elements reside. What I
didn't think of was that these elements still existed, and although
invisible, they blocked me from shrinking that area of the header. Solution:
Move these elements out of the way when invisible, then the height adjustment
to the header works. For example:

If Not Me.Detail.Visible Then
With Me
.Line21.Visible = False
.Line21.Top = 0.0417
.Line22.Visible = False
.Line22.Top = 0.0417
.Line23.Visible = False
.Line23.Top = 0.0417
.Line20.Visible = False
.Line20.Top = 0.0417
.lblProcedure.Visible = False
.lblProcedure.Top = 0.0417
.lblTotalLabor.Visible = False
.lblTotalLabor.Top = 0.417
.GroupHeader0.Height = 0.3
End With
End If
 
Back
Top