Dear all,
I have a continuous subreport in a report that has 4 text boxes per record. I have each of the text boxes set to cangrow = yes and canshrink = yes. All boxes are memo fields and depending on the contect txtBox1 may be taller than txtbox2 or visa versa etc. I was hoping to be able to set the height of each box to the tallest in code so that all the text boxes appear to make an evenly spaced table. Here is my code but it doesn't seem to work:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intCommentHeight, intActionHeight, intWhoHeight, intNewHeight As Integer
Dim ctl As Control
intCommentHeight = Me.comment.Height
intActionHeight = Me.action.Height
intWhoHeight = Me.who.Height
If intCommentHeight >= intActionHeight Then
intNewHeight = intCommentHeight
Else
intNewHeight = intActionHeight
End If
If intWhoHeight >= intNewHeight Then
intNewHeight = intWhoHeight
End If
Me.comment.Height = intNewHeight
Me.action.Height = intNewHeight
Me.who.Height = intNewHeight
Me.when.Height = intNewHeight
End Sub
Any help would really be appreciated. I attached a screen shot of what I am trying to avoid.
thanks
GPM
I have a continuous subreport in a report that has 4 text boxes per record. I have each of the text boxes set to cangrow = yes and canshrink = yes. All boxes are memo fields and depending on the contect txtBox1 may be taller than txtbox2 or visa versa etc. I was hoping to be able to set the height of each box to the tallest in code so that all the text boxes appear to make an evenly spaced table. Here is my code but it doesn't seem to work:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intCommentHeight, intActionHeight, intWhoHeight, intNewHeight As Integer
Dim ctl As Control
intCommentHeight = Me.comment.Height
intActionHeight = Me.action.Height
intWhoHeight = Me.who.Height
If intCommentHeight >= intActionHeight Then
intNewHeight = intCommentHeight
Else
intNewHeight = intActionHeight
End If
If intWhoHeight >= intNewHeight Then
intNewHeight = intWhoHeight
End If
Me.comment.Height = intNewHeight
Me.action.Height = intNewHeight
Me.who.Height = intNewHeight
Me.when.Height = intNewHeight
End Sub
Any help would really be appreciated. I attached a screen shot of what I am trying to avoid.
thanks
GPM