cath said:
I have a label and a text box on a report both with solid borders. The text box pulls data from the database. I want the height of the label to grow if the text box height grows such that both the text box and the label height are same. How can I do this with code?
The problem is complicated by a catch 22 situation. The
Format event is too early to determine the Height of the
text box and the Print event is too late to change the
Height of the label.
What that means is that you have to come up with a different
approach that avoids the issue. Let's consider that you
don't really want the label to grow, all you actually want
is for the border of the label to be the same height as the
text box. While you can not do that, you can use the
report's Line method to draw lines. In the Print event, you
can get the text box's final Height and draw the box around
it something like this:
Me.Line (label.Left, label.Top) - Step(label.Width,
textbox.Height), B