Question : How do I change the height of a decorative border box conditionally on the contents of a text box within the box

Everything in the code below works with the exception of box16.  In the first record, the Comments field is null and box16 does shrink.  However, in subsequent records that do have comments, box16 does not grow.  Unlike the detail and textbox objects, the box does not have a CanGrow property.  If I remove box16 the report does work but doesn't look the way I want it to.

Thanks,

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intLen As Integer
    If IsNull(Me![strComments]) = True Then
        intLen = 0
    Else
        intLen = Len(Me![strComments])
    End If
    If intLen > 0 Then
        Detail.Height = 0.75
        Me![Box16].Height = 0.75
        Me![Text20].Height = 0.25
    Else
        Me![Text20].Height = 0
        Me![Box16].Height = 0.5
        Detail.Height = 0.5
    End If
End Sub

Answer : How do I change the height of a decorative border box conditionally on the contents of a text box within the box

Random Solutions  
 
programming4us programming4us