Pedro said:
Do i set the height property to wich value?
I don't know, probably something you'll have to calculate.
The calculation will depend on if the subform has
header/footer sections, the height of the detail and the
number of records in the subform's record source
table/query.
I you want to make the subform tall enough to display just
the records (up to a limit) in it's record source, then
maybe this example code will give you the general idea:
Private Sub Form_Load()
Dim rs As Recordset
Dim lngDetailHgt As Long
Dim lngSfmHgt As Long
Const MAXHGT As Long = 6 * 1440
With Me.sfmResizeSub.Form
lngDetailHgt = .Section(0).Height
Set rs = .RecordsetClone
rs.MoveLast
lngSfmHgt = rs.RecordCount * lngDetailHgt _
+ .Section(1).Height _
+ .Section(2).Height
If lngSfmHgt > MAXHGT Then
lngSfmHgt = MAXHGT
End If
Me.InsideHeight = Me.sfmResizeSub.Top _
+ Me.Section(2).Height _
+ Me.Section(2).Height _
+ lngSfmHgt
Me.sfmResizeSub.Height = lngSfmHgt
End With
End Sub
You will have to study those concepts to understand how to
adapt the code to your situation, it is extremely unlikely
it will work for you as it is.
--
Marsh
MVP [MS Access]