caputring the height of a field that is set to CanGrow

G

Guest

i have a textbox in the detail section of a report that is set to CanGrow. there are other objects such as lines and boxes that are in the detail section aswell that i want to grow along w/ the textbox. i have tried to capture the height property of the section and the textbox during the format event w/o success. if i could capture the height of the textbox, which will vary w/ data contained, i could then set the height of my lines to match the textbox

is there a way to grab the height, or am i faced w/ another access limitation

thanks for you time
 
D

Duane Hookom

You can grab the height of the "grown" text box in the On Print event of the
section. Of course, this may be too late to set the size of other controls.
This may have changed in later versions of Access. I generally grab the
maximum height and then use the Line method of the report to draw lines and
boxes exactly where needed.

--
Duane Hookom
MS Access MVP


J-dawg said:
i have a textbox in the detail section of a report that is set to CanGrow.
there are other objects such as lines and boxes that are in the detail
section aswell that i want to grow along w/ the textbox. i have tried to
capture the height property of the section and the textbox during the format
event w/o success. if i could capture the height of the textbox, which will
vary w/ data contained, i could then set the height of my lines to match the
textbox.
 
M

Marshall Barton

J-dawg said:
i have a textbox in the detail section of a report that is set to CanGrow. there are other objects such as lines and boxes that are in the detail section aswell that i want to grow along w/ the textbox. i have tried to capture the height property of the section and the textbox during the format event w/o success. if i could capture the height of the textbox, which will vary w/ data contained, i could then set the height of my lines to match the textbox.

is there a way to grab the height, or am i faced w/ another access limitation?


It's a chicken and egg situation - The Height of a CanGrow
text box is not known until the Print event, but you can
only change the Height of a control in the Format event.

The way around this dilemma is to make the Borders of all
your controls Transparent and draw lines to simulate the
control borders in code using the Line method. This can get
kind of tricky when a text box grows across a page boundary.

Fortunately, Stephen Lebans has worked all the details in
his PrintLines procedure at:
http://www.lebans.com/PrintLines.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top