Hi,
I'd like to produce a report that basically looks like an excel printout.
Description:
Profile Print Report
Detail Section with 3 bordered text boxes
all text boxes are 'abutted' against each other (where one ends, the next begins)
all text boxes have the 'can grow' property set to yes.
Detail Section with 'can grown' = yes
Desire:
allow that all 3 cells grow equally.
However, I would like the bordered cells to always be of the same height.
Basically, if one text box is taller than the other 2, the other two have adequate whitespace inside the textbox to cause all 3 to be of equal height.
What event of the detail section can I use so that either all 3 text boxes end up as tall as the detail section or each text box height = the height of the tallest text box after it has 'grown'?
Thanks!
Have look at the LINE method in an Access Report to draw a rectangle around each of the text boxes. (examine the arguments that constitute that method, particularly the last argument if you wish to fill the rectangle with a specific colouring)
By looping through the controls you intend to work with ie: referenced in an zero based array you could thus draw a rectangle around each one commensurate with the height of the 'tallest' textbox control referenced.
This would then give the 'appearance' of each textbox having the same height with borders in effect 'drawn' at runtime. (you could set the actual border color property of each control itself to the same as the detail section)
If as you say the textboxes are butted up to each other arranged left to right in the detail section of the report with the controls set to grow, then try the following in the ON PRINT property of the detail section. (I,ll leave you to deal with your own error handling)
-
On Error Resume Next
-
Dim lngCounter As Long, dblMaxHeight As Double
-
dblMaxHeight = 0
-
ReDim strcontrol(3)
-
strcontrol(0) = "TheNameOfYourTextBoxOne"
-
strcontrol(1) = "TheNameOfYourTextBoxTwo"
-
strcontrol(2) = "TheNameOfYourTextBoxThree"
-
For lngCounter = 0 To UBound(strcontrol)
-
If Me(strcontrol(lngCounter)).Height > dblMaxHeight Then dblMaxHeight = Me(strcontrol(lngCounter)).Height
-
Next
-
For lngCounter = 0 To UBound(strcontrol)
-
If lngCounter = 0 Then
-
Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
-
Else
-
Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B
-
End If
-
Next
-
Hope this helps you
Regards
Jim