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

conconate two different strings in a text box 1

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
I have a text box that only part of it needs to be underlined. I've tried to enter the text in one text box but it doesn't let me underline just the parts shown below.

What I need is...
Non Compliance with any terms or conditions of this permit or Section 814 of the 2015 xxxx Plumbing
and Fuel Gas Code
shall constitute a violation and be grounds for enforcement action, as outlined in xxxx's Enforcement Response Plan. Such enforcement action may include civil citations and permit suspension or revocation.

In the event that this permit expires, is revoked, or otherwise made invalid, all wastewater
discharges into the sewer system shall immediately cease.

This permit is granted to the above vehicle, by the xxxx, for the time period set forth as follows:

What I have is....

[highlight #FCE94F]=IIf([TRANSACT]="ZERO DISCHARGE","","Non Compliance with any terms or conditions of this permit or Section 814 of the 2015 xxxx Plumbing
and Fuel Gas Code shall constitute a violation and be grounds for enforcement action, as outlined in xxxx's Enforcement Response Plan. Such enforcement action may include civil citations and permit suspension or revocation." & (Chr(13)+Chr(10)) & (Chr(13)+Chr(10)) & "In the event that this permit expires, is revoked, or otherwise made invalid, all wastewater discharges into the sewer system shall immediately cease." & (Chr(13)+Chr(10)) & (Chr(13)+Chr(10)) & "This permit is granted to the above vehicle, by the xxxx, for the time period set forth as follows:")[/highlight]

currently I took the underlined portion and stuffed it into another text box and then tried to line the 2 boxes up. This is ok until they make wording changes then it's back to guessing on placement. Also, since there are different types of permits, I actuall have another box that I have to make the same changes to so depending on the type of permit, only one of the boxes show at any given time.

There has got to be an easier way :) Any suggestions??
 
You need to set the textbox text format property to RichText. You can now use all the formatting controls on parts of text. So if you bolded, colored, or underlined a section what happens in the background is that text gets surrounded by rich text tags. You just do not see them, but you see the result.

So programmatically you need to add the tags. See thread Thread702-1676863 and related threads.

"This is how to <div><u>" & "underline" & "</u></div> some Text"

A good way to learn the tags is to make a memo field, and bind two textboxes to the memofield. Make one rich text and the other plain text. Format the rich text using the formatting controls, and in the plain text box you will see the tags.
 
Actually the easiest solution is to make a small table and have your formatted text in there. You can then join on that or use a dlookup. That way no need for any code. Just format the text in the rich text field.

a284ef.png
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top