Unfortunately, the final CanGrow(n) height of the TextBox is not
available until the Print event where you are not permitted to resize
controls.
The OPs two options are:
1) Use the Line method of the Report object to draw the boxes
programmatically in the Print event. Scroll down the page to the older
non class based solutions.
http://www.lebans.com/PrintLines.htm
or
2) Use the TextWidthHeight functions on my site in the Format event of
the relevant section.
http://www.lebans.com/textwidth-height.htm
TextHeightWidth.zip is a replacement for the Report object's TextWidth
and TextHeight methods. It is multiline aware and can work in both
Report and Form views. Includes a sample report to show you how to
autosize individual controls with different formatting on the same line
to simulate RTF style text.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Wolf" <sp*************@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hmmm, interesting. Here's a quick hack that seemed to work when I
tested it.
First, set the TAG property of any controls that you want to resize to
"Size" (without the " quotes).
Then, place this hack in the "On Format" event of the section of the
report that contains the controls to be resized. I used the detail
section.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ctr As Control
Dim hgt As Variant
hgt = 0
For Each ctr In Me.Controls
If ctr.Tag = "Size" Then
If ctr.Height > hgt Then hgt = ctr.Height
End If
Next
For Each ctr In Me.Controls
If ctr.Tag = "Size" Then
ctr.Height = hgt
End If
Next
End Sub
If you want to resize ALL the controls in the section then don't
bother with setting the tag to "size" and remove the lines of code looking
for it. It'll save you some time setting up the report especially if you
are adding and removing fields.
HTH