View Full Version : Can I ajust the height of a report section


wjburke2
09-13-2008, 03:34 PM
I want to ajust the height of a report section based on the record type field. This section has several text fields that I make invisible if it is record type 2. I want the section to srink so it prints closer to the next section heading. I have tried ajusting it using the Height property in VBA but it remains the same height. Is this posible?

Here is my code.
If TestFlag = "2" Then
Me.GroupHeader1.Height = 0.1
Me.GroupHeader2.Visible = False
GoTo Exit_GroupHeader2_Format
Else
Me.GroupHeader2.Visible = True
End If

wjburke2
09-13-2008, 03:41 PM
opps wrong code
If TestFlag = "2" Then
Me.lblPkgId.Visible = False
Me.lblAppForm.Visible = False
Me.lblProd.Visible = False
Me.lblPlan.Visible = False
Me.lblFace.Visible = False
Me.lblApp.Visible = False
Me.txtHdg0.Visible = False
Me.txtHdg1.Visible = False
Me.txtHdg2.Visible = False
Me.txtHdg3.Visible = False
Me.txtHdg4.Visible = False
Me.txtHdg5.Visible = False
Me.txtHdg7.Visible = False
Me.GroupHeader1.Height = 0.1
GoTo Exit_GroupHeader1_Format
Else
Me.lblPkgId.Visible = True
Me.lblAppForm.Visible = True
Me.lblProd.Visible = True
Me.lblPlan.Visible = True
Me.lblFace.Visible = True
Me.lblApp.Visible = True
Me.txtHdg0.Visible = True
Me.txtHdg1.Visible = True
Me.txtHdg2.Visible = True
Me.txtHdg3.Visible = True
Me.txtHdg4.Visible = True
Me.txtHdg5.Visible = True
Me.txtHdg7.Visible = True
End If

gemma-the-husky
09-14-2008, 01:57 AM
i thing it needs to be included in the "format" event of whatever report section you are printing

You might try the "print" event, as well.

Brianwarnock
09-14-2008, 08:59 AM
I think invisible means exactly that, its still there but you cannot see it, therefore the number of controls that Access will allow for is the same.

Brian

Rich
09-14-2008, 10:15 AM
Why not just use the CanGrow/Shrink options?

wjburke2
09-14-2008, 11:38 AM
Thanks,

The code is in the GroupHeader1_Format section. I will try putting it in the print section. I think I set the Canshrink CanGrow to yes for this section. I will check to make sure. I am afraid that Access won't allow a section to shrink smaller than the bottom of the last control even if they are invisible. This gives me some things to check.

Thanks,
Again