Determine "Height" of Memo Value

D

dymondjack

This is probably a long shot, but I was curious if anyone knows if there is a
way to determine how high or tall the text for a given memo field value may
be when displayed in a control.

The reason I ask, I have a purachse order report with a Notes memo at the
bottom, which I have set to be approximately 1.5 inches tall (for the control
on the report). What I've noticed is that if the notes entered in the PO
form will take up more space than the control on my report, the extra notes
are not displayed because there isn't enough room.

Ideally, I would like to increase the Height of this control, but not have a
big empty area on the report for 90% of the time when the notes will fit in
the standard height control.

The idea I'm currently forming in my head is an evaluation of the value of
the Memo field, possible a character count and line breaks to see if I can
get an approximate total text height based on the constant width of the
control and the font. And if the calculated text height is more than X set
the Top and Height values accordingly.

Sound right? I'm assuming I can't be the first person to run into this, so
I'm hoping someone might be able to offer some advice on how they've handled
a similar situation?

Thanks in advance if anyone has any ideas. If I don't hear anything in a
few days I'll start in on this evaluation of the memo value...


--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
F

fredg

This is probably a long shot, but I was curious if anyone knows if there is a
way to determine how high or tall the text for a given memo field value may
be when displayed in a control.

The reason I ask, I have a purachse order report with a Notes memo at the
bottom, which I have set to be approximately 1.5 inches tall (for the control
on the report). What I've noticed is that if the notes entered in the PO
form will take up more space than the control on my report, the extra notes
are not displayed because there isn't enough room.

Ideally, I would like to increase the Height of this control, but not have a
big empty area on the report for 90% of the time when the notes will fit in
the standard height control.

The idea I'm currently forming in my head is an evaluation of the value of
the Memo field, possible a character count and line breaks to see if I can
get an approximate total text height based on the constant width of the
control and the font. And if the calculated text height is more than X set
the Top and Height values accordingly.

Sound right? I'm assuming I can't be the first person to run into this, so
I'm hoping someone might be able to offer some advice on how they've handled
a similar situation?

Thanks in advance if anyone has any ideas. If I don't hear anything in a
few days I'll start in on this evaluation of the memo value...

Regarding ... "report with a Notes memo at the bottom"?
Bottom of what? the Detail Section? The Report Footer? The Page
Footer? A Group Header or Footer?

I'll assume it's at the bottom of the Detail section.
Set the memo control's CanGrow property to Yes.
Also set the Detail Section CanGrow property to Yes.
It's located on the Format tab of the property sheet.

If you meant the bottom of the Page Footer, the Page Footer does not
have a CanGrow capability so you will have to move the Memo control
elsewhere.

See VBA help on CanGrow and CanShrink.
 
M

Marshall Barton

dymondjack said:
This is probably a long shot, but I was curious if anyone knows if there is a
way to determine how high or tall the text for a given memo field value may
be when displayed in a control.

The reason I ask, I have a purachse order report with a Notes memo at the
bottom, which I have set to be approximately 1.5 inches tall (for the control
on the report). What I've noticed is that if the notes entered in the PO
form will take up more space than the control on my report, the extra notes
are not displayed because there isn't enough room.

Ideally, I would like to increase the Height of this control, but not have a
big empty area on the report for 90% of the time when the notes will fit in
the standard height control.

The idea I'm currently forming in my head is an evaluation of the value of
the Memo field, possible a character count and line breaks to see if I can
get an approximate total text height based on the constant width of the
control and the font. And if the calculated text height is more than X set
the Top and Height values accordingly.


Most of the time all you need to do is set the text box's
CanGrow property to Yes.

If there is some reason why that doesn't do what you need,
then download the TextHeightWidth functions at:
www.lebans.com
 
D

dymondjack

Thanks guys, I wasn't aware of the CanGrow/Shrink properties. I'm pretty
sure this should take care of it.

I'll take a look at Leban's functions as well, though I don't expect to need
them at this point. I knew there was one out there for the width, I didn't
know he had one for height.

Thanks again
--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 

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