Dynamically change detail section height ?

  • Thread starter Thread starter rob
  • Start date Start date
R

rob

Is it possible to change the height of the detail section of a form using
the "On Open" event ?

If so, what is the syntax ?
 
Yes,
Your form should be larger than the detail though.
on open....
Me.InsideHeight = 7000 'this is the form's height
Me.Detail.Height = 3880 'this is detail
'expressed in twips

HTH
Damon
 
Almost Damon, as you said, the height of the form is set
using InsideHeight. But the height of the detail section is
whatever is left over after the form header and footer
sections are displayed. I.E. there is no effect (and hence
no reason) in setting the detail height.

To set the form height so the detail is a predetermined
height, use something more like:

Me.InsideHeight = Me.Section(1).Height + _
Me.Section(2).Height + desireddetailheight

Note that if the form doesn't have the header/footer
sections, those terms must be omitted from the expression.
 
Yes, you are absolutely right. I was thinking of a form without
headers/footers -but then what would be the sense, other than a line on the
form?
:)
Damon
 
Thank you Damon and Marshall for responding...

Regarding Me.Section(1) and Me.Section(2). - what do the (1) and (2)
represent ?

I should have specified that I am using a Continuous form which includes
Headers and Footers. It appears that for my purposes the setting
Me.Detail.Height = 250 alone does the trick. (I have 5 rows of data during
design, but based selection from option box, only 1 row is ever presented at
a time. I am manipulating the Top, Visible, and Enabled properties of
each text box in the row to do this.)

Thanks !



Marshall Barton said:
Almost Damon, as you said, the height of the form is set
using InsideHeight. But the height of the detail section is
whatever is left over after the form header and footer
sections are displayed. I.E. there is no effect (and hence
no reason) in setting the detail height.

To set the form height so the detail is a predetermined
height, use something more like:

Me.InsideHeight = Me.Section(1).Height + _
Me.Section(2).Height + desireddetailheight

Note that if the form doesn't have the header/footer
sections, those terms must be omitted from the expression.
--
Marsh
MVP [MS Access]



Damon said:
Yes,
Your form should be larger than the detail though.
on open....
Me.InsideHeight = 7000 'this is the form's height
Me.Detail.Height = 3880 'this is detail
'expressed in twips
 
rob said:
Regarding Me.Section(1) and Me.Section(2). - what do the (1) and (2)
represent ?

Section 0 is the detail section
Section 1 is the form/report header section
Section 2 is the form/report footer section
Section 3 is the form/report page header section
Section 4 is the form/report page footer section
Section 5 is the report group1 header section
Section 6 is the report group1 footer section
Section 7 is the report group2 header section
. . .
I should have specified that I am using a Continuous form which includes
Headers and Footers. It appears that for my purposes the setting
Me.Detail.Height = 250 alone does the trick. (I have 5 rows of data during
design, but based selection from option box, only 1 row is ever presented at
a time. I am manipulating the Top, Visible, and Enabled properties of
each text box in the row to do this.)

I'm afraid I don't understand what you're doing, but it
sounds like you've found a workable solution, so it doesn't
matter.
 
Back
Top