Forum Discussion
Format text box as italics and blue
- Jan 13, 2022
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.
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_gpJan 13, 2022Iron 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>"- Tony2021Jan 13, 2022Iron Contributor
George, I have made the change of both fields to Rich Text. The output seems unchanged. I do remember that sometimes you could get extranneous characters (# sign or some < > or others). I do not see any of those characters in the conversion.
Arnel, thank you.
Should I populate the above with my font and not sure if I need to populate em with something?The output looks like this (no change in text color and I see the codes.
- George_HepworthJan 13, 2022Silver Contributor
Tony2021 You should have a Ribbon Tab enabled for the Rich Text controls which offers the options of font and color, etc. No need to enter the markup manually.
- George_HepworthJan 13, 2022Silver ContributorUnfortunately, no. Access provides Rich Text for tasks like this. It relies on HTML to format the text in that field. Otherwise, the control is a unitary object containing Plain Text that can only take one format.
On the other hand, converting the field in the table and in the report should not be all that onerous.