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!

Combining text in a Control on a Report

Status
Not open for further replies.

Aubs010

Technical User
Apr 4, 2003
306
GB
Is there a way of combining 2 text fields into one, but having different fonts?

e.g.

In a table, I have 2 fields, Comments and Recommendations.

I want to combine them in a TextBox on a report.

I know I can do it by using:

=[Comments] & "

" & [Recommendations]

That makes this:

Comments: Hello, this is a comment. I'm only going to give comments for now!
Recommendations: This is the recommendation. If you don't do what I tell you, evil will reside!

Into this:
Code:
Hello, this is a
comment. I'm only
going to give
comments for now!

This is the
recommendation. If
you don't do what
I tell you, evil
will reside!

Is there any way I can have the recommendation in a different colour or font or something?

Many thanks for anyone who helps.

Regards,

Aubs
 
Why combine them?? Why don't you leave them as seperate controls, comments stacked over recommendations, and set their Can Grow properties to Yes. Left apart, you can set the fonts and other properties of each control....
 
Thanks Cosmo,

That's a good point!!!

The problem is, I don't want them to be able to grow above a certain height, because I have used code to dreate lines and page breaks etc!

Is there a way to limit how much they can grow, or do they only grow to the space you provide in the detail section?

Thanks again,



Aubs
 
Sure, if you set their Can Grow and Can Shrink properties to No, then they will remain the size you defined, regardless of the length of text inside them....
 
Yes, but if I have a comment, and below it, the recommendations.

If the comment is long, I still want the recommendations to be below the comment, BUT, if the textbox grows to be bigger than the amount of space I allocate for the records, I want it to stop growing.

I think I've explained it well enough, if not, let me know.



Aubs
 
Right...If you create the text boxes as the maximum size you want to allow, then set the grow and shrink properties to No, they will not use less or more space than you have defined. Is this what you are looking for??
 
Well, the comments have to be above the recommendations, if the comment is 3 lines, the recommendation will be below it, starting on line 4, if the comment is 5 lines, the recommendation will start on line 6

Thanks again,



Aubs
 
OK, I think I get it now...

Define the comments text box to be the maximum size you want to allow for it. Set its Can Grow property to No and its Can Shrink property to Yes. Place the recommendations text box under the comments one. This should be what you're looking for......
 
Not really, because there are other controls on the same line that would affect the canshrink, so it wouldn't work, unfortunately.

What I have done though, is as you said, but just left it like that. If it doesn't fit, then it's upto the author of the report to re-word what they want to say to make it fit in!!!

Thanks for all your help cosmo :)



Aubs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top