P
PeteCresswell
Got a report with a subreport in it.
The detail section has a box around it.
Have recently added the subreport to the detail section.
..CanGrow=True
..CanShrink=True
I want to expand the enclosing rectangle and push down some labels to
accomodate varying sizes of subreports.
Some subreports have zero items, some have 1 item, others have many
items.
Here's what I'm doing now, but it doesn't seem tb capturing the new
size of each subreport.
The subreport is in .subLadderChildren, the rectangle is
called .rctMain, and
the label names all begin with .lblSignoff_
--------------------------------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
1000 DebugStackPush Me.Name & ": Detail_Format"
1001 On Error GoTo Detail_Format_err
' PURPOSE: - To give a little more distinction between buys and
sells
' by toggling the back/forecolors
' - To push the signoff line/labels down to accomodate the
' varying size of the subreport
' - To size the enclosing rectangle per size of subreport
1002 Dim newSignoffTop As Long
Const vPad As Long = 50
1009 Cancel = mNoData
1010 If mNoData = False Then
1011 With Me.txtTradeType
1012 If .Value = "Sell" Then
1013 .BackColor = gColor_JetBlack
1014 .ForeColor = gColor_White
1019 Else
1020 .BackColor = gColor_White
1021 .ForeColor = gColor_JetBlack
1022 End If
1029 End With
' --------------------------------------
' Attempt to capture height of subform
' and concoct a .Top for the signoff line
' from it
1040 With Me.subLadderChildren
1041 newSignoffTop = .Top + .Height + vPad
1049 End With
' --------------------------------------
1050 With Me
1051 .linSignoff.Top = newSignoffTop
1052 .lblSignoff_Confirmation.Top = newSignoffTop + vPad
1053 .lblSignoff_Contact.Top = newSignoffTop + vPad
1054 .lblSignoff_Date.Top = newSignoffTop + vPad
1055 .lblSignoff_Time.Top = newSignoffTop + vPad
1059 End With
1060 With Me.rctMain
1061 .Height = .Top + Me.lblSignoff_Confirmation.Top +
Me.lblSignoff_Confirmation.Height
1069 End With
1999 End If
Detail_Format_xit:
DebugStackPop
On Error Resume Next
Exit Sub
Detail_Format_err:
BugAlert True, ""
Resume Detail_Format_xit
End Sub
--------------------------------------------------------------------------------
The detail section has a box around it.
Have recently added the subreport to the detail section.
..CanGrow=True
..CanShrink=True
I want to expand the enclosing rectangle and push down some labels to
accomodate varying sizes of subreports.
Some subreports have zero items, some have 1 item, others have many
items.
Here's what I'm doing now, but it doesn't seem tb capturing the new
size of each subreport.
The subreport is in .subLadderChildren, the rectangle is
called .rctMain, and
the label names all begin with .lblSignoff_
--------------------------------------------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
1000 DebugStackPush Me.Name & ": Detail_Format"
1001 On Error GoTo Detail_Format_err
' PURPOSE: - To give a little more distinction between buys and
sells
' by toggling the back/forecolors
' - To push the signoff line/labels down to accomodate the
' varying size of the subreport
' - To size the enclosing rectangle per size of subreport
1002 Dim newSignoffTop As Long
Const vPad As Long = 50
1009 Cancel = mNoData
1010 If mNoData = False Then
1011 With Me.txtTradeType
1012 If .Value = "Sell" Then
1013 .BackColor = gColor_JetBlack
1014 .ForeColor = gColor_White
1019 Else
1020 .BackColor = gColor_White
1021 .ForeColor = gColor_JetBlack
1022 End If
1029 End With
' --------------------------------------
' Attempt to capture height of subform
' and concoct a .Top for the signoff line
' from it
1040 With Me.subLadderChildren
1041 newSignoffTop = .Top + .Height + vPad
1049 End With
' --------------------------------------
1050 With Me
1051 .linSignoff.Top = newSignoffTop
1052 .lblSignoff_Confirmation.Top = newSignoffTop + vPad
1053 .lblSignoff_Contact.Top = newSignoffTop + vPad
1054 .lblSignoff_Date.Top = newSignoffTop + vPad
1055 .lblSignoff_Time.Top = newSignoffTop + vPad
1059 End With
1060 With Me.rctMain
1061 .Height = .Top + Me.lblSignoff_Confirmation.Top +
Me.lblSignoff_Confirmation.Height
1069 End With
1999 End If
Detail_Format_xit:
DebugStackPop
On Error Resume Next
Exit Sub
Detail_Format_err:
BugAlert True, ""
Resume Detail_Format_xit
End Sub
--------------------------------------------------------------------------------