How can I change font "mid-stream" in a text box in Access 2010?

I have a text box in an Access 2010 report.  Mostly it is pre-typed text, but has the value of a text field sandwiched in between.  I would like to have the first part of the text box one font, then have the text value another font, and then return to the first font for the rest.  I would like to have it all within one text box so that it wraps correctly, and can grow or shrink if necessary.
I looked for some kind of formatting string I could insert, such as
="This certifies that"&[namefield]&"is a member of the organization" would turn into ="This certifies that"&Format([namefield], fontname)&"is a member of the organization"
but could find no such thing.
Thanks, Experts!
Nero83Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can use a RichTextBox in 2010, and then format it using standard HTML or RTF commands. HTML is by far the simplest way to deal with text formatting, as RTF can be very difficult to get right.

An example would be:

This is the first font and <font face="verdana">This is the second font!</font>
0
Nero83Author Commented:
Scott,
Thanks for the reply.  I can't change it to a RichTextBox in report design view.  My table only contains the value that's sandwiched in the middle of the text currently.  How would I go about setting this up?
Chris
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sorry, I didn't explain myself well.

You must change the Textbox from "Plain Text" to "Rich Text" in design view. This is on the property sheet Data tab.

My table only contains the value that's sandwiched in the middle of the text currently
I'm not sure what you mean by that.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Nero83Author Commented:
Thanks!! I got the text box into Rich Text. I have a problem now when I try this an error message pops up: The expression you entered contains invalid syntax.
This is my text box where I just tried changing the font on the word "all":
="                   THIS CERTIFIES THAT " & [TRANSFEREEVESTING] & " is the owner of one membership Series of " & [LONGNAME] & ", a non-profit mutual benefit California Corporation which may not make distributions to its members except upon dissolution, and is entitled to <font face="verdana">all </font>the benefits and privileges of membership in said Corporation, and subject to all of the terms, conditions, and restrictions, as set forth in the Articles of Incorporation, By-Laws, and Occupancy Agreement of said Corporation."

Thanks for the help...this one is new to me.
0
Nero83Author Commented:
Sorry...in this case I am using 2013...I am unfortunately using 2010 and 2013 in different offices to work on the same database...maybe that's causing problems with this?
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
If you remove the <font ..> tags, does it work as expected?

What is [TRANSFEREEVESTING]? If that's a Field or Control, you should preface it with the correct qualifier. For example, Me.TRANSFEREEVESTING.
0
Nero83Author Commented:
Yes, without the font tags it's fine (except it's all one font of course).

Yes, [transfereevesting] is a field containing a text value.  This is the field that I need to be a different font than the remainder of the text box.  I've never had to preface one of these with a qualifier before, I've always just concatenated it into the rest of the text with ampersands.

Thanks.
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sorry - been a while since I worked with Rich Text. You have to use a different format when saving.

Here's an example of a Rich Text field that I created and then modified the font and such using the interface,

<div>Test to <strong>determine how</strong> Access stores this for<font face=Belgium> </font><font face=Belgium color=red>rich text</font>.</div>

Open in new window


You can see it's enclosed by <div> tags, so change your code to show this sort of structure. Also, note that that attributes of the <font> tag are NOT enclosed in single or double quotes. The exception to that would be if an attribute value contains a space. For example:

<div><u>Your Original Text Here</u> with the <font face="Arial Black" color=red>new font here</font></div>

Open in new window


Note in the above I've chosen Arial Black, and Access stored it with double quotes around the name.
0
Nero83Author Commented:
Thanks!  I'll try on Tuesday when I get back to work.  Before then, I still have questions:

I guess this is all preceeded by an equal sign and quotes to enclose the text except around the field name, and that I should use the same end-quote + ampersand + [field name] + open-quote + remaining text.

="<div>Beginning text "& <font face=verdana>[transfereevesting] </font>& "<font face = arial>the remaining part of the text</div>"
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'd think it would be:

="<div>Beginning text <font face=verdana>" & [transfereevesting] & " </font><font face = arial>the remaining part of the text</font></div>"

And don't forget the ending </font> tag (I highlighted it in bold).

You might also find it easier to create that "field" in the underlying query, assuming your static text doesn't change.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nero83Author Commented:
Thanks for all your help, Scott.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.