bolding words in Access Report (html tags?)

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hello, I need to bold specific words in a field in an
Access report. The text is stored in an SQL database and
linked to Access. I can have the words marked in SQL
using html tags (<b>boldword</b>). What I would like to
do is use vb to convert these words (which are randomly
dispersed throught the records) in the report to display
as bold. The vb would need to find the tagged words,and
then bold only the tagged word(s) in the report.
I have played with Lebahn's example of bolding the last
name in a field, but can't seem to get it to work with
this scenario. Any thoughts? Client says this is a
showstopper.. :-( Many thanks in advance.
 
Chris said:
Hello, I need to bold specific words in a field in an
Access report. The text is stored in an SQL database and
linked to Access. I can have the words marked in SQL
using html tags (<b>boldword</b>). What I would like to
do is use vb to convert these words (which are randomly
dispersed throught the records) in the report to display
as bold. The vb would need to find the tagged words,and
then bold only the tagged word(s) in the report.
I have played with Lebahn's example of bolding the last
name in a field, but can't seem to get it to work with
this scenario. Any thoughts? Client says this is a
showstopper.. :-( Many thanks in advance.

Unless you are using an RTF ActiveX control you cannot apply bold (or any
other formatting) to only a portion of the text in the control. You either
have to use an RTF control or use the print method available in reports.
That allows you to place text on the report through code without using
controls at all.
 
If you require a multiline solution then you would have to use an RTF
control and programmatically manipulate the incoming text to convert the
HTML tags to their equivalent RTF control codes.

Another solution would be to copy the incoming HTML formated text to the
Clipboard and then ask the CLipboard to convert this to RTF. It works as
long as the incoming data's formatting characteristics are directly
supported by RTF. You would then copy the RTF from the Clipboard into an
RTF ActiveX control.

The solution you are looking at on my site is really a single line
solution.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top