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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bolding Text via Format Function

Status
Not open for further replies.

Chopper

Programmer
May 30, 2000
59
US
I have a text box on a report, that is populated with a string based on certain criteria.&nbsp;&nbsp;The string is rather long (several sentences), and I would like some of the text that is displayed to be in bold font.&nbsp;&nbsp;<br><br>Does anyone know of a good way to do this?<br><br>I had anticipated I could use the format function, as in:<br><br>me.txtTextbox = &quot;Some text.&nbsp;&nbsp;&quot; & format(&quot;I want this to be bold.&quot;, &quot;BoldFace&quot;) & &quot;&nbsp;&nbsp;The rest of my text that is not bold&quot;<br><br>I do not want to have to use more than one text box to display my text, and the textbox must be populated via code.<br><br>Any help is greatly appreciated.<br><br>-Chopper
 
You might think about using multiple text boxes, positioned on your form, and change the font for each separate text box.<br><br>For example, <br>¦Test Box 1 - normal¦ ¦Text Box 2 - Bold¦ ¦TextBox 3 - normal¦, all on one line.
 
Macrodan,<br><br>Thanks for the response, however, I cannot use multiple textboxes, as I fill the text box with one of several paragraphs of text, each of varying length.&nbsp;&nbsp;Part of the paragraph is bold, and part is not.&nbsp;&nbsp;If I use multiple text boxes, there will be undesireable blank space within the paragraph.&nbsp;&nbsp;<br><br>Since posting this yesterday, I read that one could use a blank picture in lieu of a text box and use the print command to print lines of text to it.&nbsp;&nbsp;Then, one of sentences could use bold text while the others do not.&nbsp;&nbsp;Has anyone heard of this, or better yet, used it?<br><br>-Chopper
 
Macrodan,<br><br>Thanks for the response, however, I cannot use multiple textboxes, as I fill the text box with one of several paragraphs of text, each of varying length.&nbsp;&nbsp;Part of the paragraph is bold, and part is not.&nbsp;&nbsp;If I use multiple text boxes, there will be undesireable blank space within the paragraph.&nbsp;&nbsp;<br><br>Since posting this yesterday, I read that one could use a blank picture in lieu of a text box and use the print command to print lines of text to it.&nbsp;&nbsp;Then, one of sentences could use bold text while the others do not.&nbsp;&nbsp;Has anyone heard of this, or better yet, used it?<br><br>-Chopper
 
Use a rich text box there you can format in code any part of text you want
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top