Forum Discussion
Tony2021
Jan 12, 2022Iron Contributor
Format text box as italics and blue
Experts, how would I format the [txtSection] as italics and blue?
=[Short Description] & " [" & [txtSection] & "]"
25 Replies
Hi,
A 20 years ago Stephen Lebans demonstrated how to do this in reports using the Print method. You can still download e.g. Luiz Claudio's derived example at http://www.lebans.com/mixbold-plain.htm which by accident even colors sth in blue. However, you have to know VBA a bit to understand and adjust it to your needs.
Servus
Karl
************
Access News
Access DevCon- George_HepworthSilver Contributor
You'll need to convert to a Rich Text data type to support having two different formats applied.
Or, you could place two Plain Text textboxes side by side for the two different formats, with the appropriate color and font applied to each.
- Tony2021Iron ContributorGeorge, thank you.
My fields are in a report if that matters.
My field is not a rich text either.
I dont think having 2 text boxes side by side would work since the field [Short Description] can grow and I need to have the txtSection at the end of the last word of field [Short Description]. Is there another trick you might know of?
I thought I could simply add the word format([txtSection],"vbBlue" (like you would a currency field) but I guess I can not do that.- arnel_gpIron Contributoragree. you should select Rich Text as Text Format for your Unbound textbox.
on its ControlSource:
=[Short Description] & " <font color=""#0072BC""><em>" & [txtSection] & "</em></font>"