Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting when Can Grow field has grown

Status
Not open for further replies.

bgeake

Programmer
Jun 8, 2005
2
GB
Is there a way for a formula to detect when another field has grown?

I'm writing a report which includes stock names, which can get very long. Hence, the field has Can Grow set. To the left of the stock name I have a text box (fixed text). If the stock name has grown, I need to have another copy of this text box on the next line.

I can assume the growth will be to a maximum of 2 lines. Hence I'd like to put the second text box in and conditionally suppress it, based on whether the stockname has grown. Can this be done?

TIA,

Bill
 
I would use the length() function to determine the size of the text in the "can grow" field

-LW
 
Unless you use a fixed-space font - something like Courier - they'll be no way to predict exactly which lenghts require more than one line.

If this matters, then I suggest you use Left({field}, 40), say, to get as much as will always display on one line. Have another detail section below this, suppressed except when the field is more than 40. Show the rest with Mid({field}, 41, 40) or whatever lengths suit.

The drawback is that this will split words between the two lines. The 'Split' function can be used to separate out words - do a SEARCH here to find examples of how to use it.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top