Link to home
Start Free TrialLog in
Avatar of Mik Mak
Mik Mak

asked on

Rich text code for bold ignored on report

In Access 13, I want to use bold text for a section of a control - but the bold codes seen below are simply ignored - italics works fine - very strange. The control is of course set to Rich text :)

="Part 1 <i><b> Bold and italics </b></i> Part 2"
Avatar of Anders Ebro (Microsoft MVP)
Anders Ebro (Microsoft MVP)
Flag of Denmark image

Thats because its not <b>
The easiest way to figure out the syntax is to create a form, with 2 textboxes.
Set textbox1 to Rich Text.

Then set textbox2 to plain text, and set its controlsource "=Textbox1"

Then do the formatting using the GUI in textbox 1, and see how the syntax looks in textbox2.

It comes out as:
<div>Part 1 <strong><em>Bold Italic</em></strong> Part 2</div>

Open in new window

Avatar of Mik Mak
Mik Mak

ASKER

Thank you for your input - but that sounds strange - every link I have found have mentioned either <b> or <strong>
You have to know that Microsoft's implementation of RTF is very weak and does not respect HTML standards.  You are always best to do as Anders suggests to the the 'format' that Microsoft prescribes to.
While it might look like HTML and has similarities to HTML, its not exactly the same. (Yes, it would probably have made more sense if it was the same syntax...). But don't kill the messenger :)
Avatar of Mik Mak

ASKER

I understand - just puzzled that every link I can find related to this only mentions either <b> or <strong> - so the correct code must be super secret - or individual per installation...
Do you have an example of such a link? Does it specifically mention Access?
I looked at that link. Nowhere did I find <b> mentioned.
Avatar of Mik Mak

ASKER

no, that link only mentions <strong>  which doesn't work either :)
Either way, try the method I mentioned in my original post.
Avatar of Mik Mak

ASKER

But thats on a form - and <div><strong>bold letters</strong></div> as it shows, works fine there - but not on the report :) - but <i> do
What build are you running?

When I did a few quick tests, it all seems to work in both Forms and Reports.

Also the tags that MS seems to us are

Bold -> <strong></strong>
Italic -> <em></em>
Underline -><u></u>
Highlight -><font style="BACKGROUND-COLOR:#FFFF00">d</font>
...
Do you need this formatting in this same "position" in the field, and in every record?

If you just need it in a few records,..you can set the bold and Italic in the table/datasheet view, ...then it will be the same way in the report.
User generated imageUser generated image
JeffCoachman
Try looking at this sample database. Does the report properly bold and italicize the words?
RichTextTest.zip
Avatar of Mik Mak

ASKER

Hmm, thank you Anders - that works perfectly... - even though the database with the problem is running on 2013/2016 - it's still an mdb file - not accdb -maybe the problem lies here, even though the formatting has nothing to do with any data-structure, as it's a fixed text field
I just tested using an mdb and it all worked fine for me.
Avatar of Mik Mak

ASKER

So Anders accdb worked fine - but my mdb did'nt - so i tried to convert it to accdb - no change. Then I tried to copy one field from Anders file to the problematic report - and that worked fine... - it turns out the "super special" font the customer is using in the reports don't support bold - goddammit :) Sorry about that guys, but thank you for all the inputs !
ASKER CERTIFIED SOLUTION
Avatar of Mik Mak
Mik Mak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good catch.  I too would have never of thought of that.
Yes, nice catch. I would not have thought of that either.
Avatar of Mik Mak

ASKER

Yes, pretty strange - have a nice evening (as it is here in Denmark :))