mixed font formatting in a single text box

  • Thread starter Thread starter ita
  • Start date Start date
I

ita

It would seem simple enough. All I am trying to do is
create a single text box in a report and apply different
formatting to individual words/characters. (As you might
guess, I would like to do this with data as well as fixed
text, so using multiple text boxes "puzzle-pieced"
together is not an option.)

For example, I would like to place a title on a report
page that reads: "My favorite report". I would like the
word "favorite" to be italicized (or bolded or red...) and
keep the "My" and "report" set to the default for the text
box.

I thought the solution may be in the Format property...
but as far as I can tell that property can't handle font
color, italics, bolding... It looks like Format can only
effect the "structure" of the output, not the font
characteristics.

(Again... I've simplified my example here. My real use for
this can not be solved by using multiple text boxes...
each formatted differently. It must be a single box.)

Any help would be appreciated.

ita
 
You use code rather than controls. For instance to print your text in the
report header section, use code in the On Format of the Page Header:

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.FontSize = 24
Dim intY As Integer
intY = 50

Me.CurrentX = 100
Me.CurrentY = intY
Me.Print "My "
Me.CurrentY = intY
Me.FontItalic = True
Me.ForeColor = vbRed
Me.Print "Favorite "
Me.CurrentY = intY
Me.FontItalic = False
Me.ForeColor = vbBlack
Me.Print "Report"
End Sub
 
It would seem simple enough. All I am trying to do is
create a single text box in a report and apply different
formatting to individual words/characters. (As you might
guess, I would like to do this with data as well as fixed
text, so using multiple text boxes "puzzle-pieced"
together is not an option.)

For example, I would like to place a title on a report
page that reads: "My favorite report". I would like the
word "favorite" to be italicized (or bolded or red...) and
keep the "My" and "report" set to the default for the text
box.

I thought the solution may be in the Format property...
but as far as I can tell that property can't handle font
color, italics, bolding... It looks like Format can only
effect the "structure" of the output, not the font
characteristics.

(Again... I've simplified my example here. My real use for
this can not be solved by using multiple text boxes...
each formatted differently. It must be a single box.)

Any help would be appreciated.

ita

This is not do-able in Access as shipped.
You can purchase and install a third party Rich Text Format control,
or see Steven Lebans web site at:
http://www.lebans.com
and see what he has available there.
 
Thanks Duane.

I was hoping to avoid using code for this one due to the
complexity of the data I'm tying together in the
pesentation... but if that's the only way :(

Thanks again.
ita
 
Thanks for the info. Strange though... It seems like a
pretty basic need that could be handled by just adding a
little extra functionality to the Format
property. ...Maybe in the next version.

ita
 
Back
Top