What I really want to do is change the detail section height depending on the
display Settings chosen for the screen area in the Control Panel.
For example:
screen area=1152 by 864 pixels
I want the detail section to be larger - displaying more records.
screen area=1024 by 768 pixels
I want the detail section to be smaller - displaying less records.
This is the code I have in the forms OnActivate:
Dim intWindowHeight As Integer
Dim intWindowWidth As Integer
Dim intTotalFormHeight As Integer
Dim intTotalFormWidth As Integer
Dim intHeightHeader As Integer
Dim intHeightDetail As Integer
Dim intHeightFooter As Integer
Dim frm As Form
Set frm = [Forms]![frmmtm]
' Determine form's height.
intHeightHeader = frm.Section(acHeader).Height
intHeightDetail = frm.Section(acDetail).Height
intHeightFooter = frm.Section(acFooter).Height
intTotalFormHeight = intHeightHeader _
+ intHeightDetail + intHeightFooter
' Determine form's width.
intTotalFormWidth = frm.Width
' Determine window's height and width.
intWindowHeight = frm.InsideHeight
intWindowWidth = frm.InsideWidth
If intWindowWidth <> intTotalFormWidth Then
frm.InsideWidth = intWindowWidth
End If
If intWindowHeight <> intTotalFormHeight Then
frm.InsideHeight = intWindowHeight
frm.Section(acDetail).Height = frm.Section(acDetail).Height +
Abs(intWindowHeight - intTotalFormHeight)
End If
Any help is greatly appreciated!!!!
Marshall Barton said:
The height of the detail section in a form is whatever space
is left over in the form's window after the header and
footer sections are displayed. What that boils down to is
that you have to use the form's InsideHeight property to
change the height of the form.
If you need additional assistance, please provide more
details about the form (header/footer and how you determine
when and how much to change the detail height).