Change font color at whim

EVP

Registered User.
Local time
Today, 20:18
Joined
Oct 10, 2003
Messages
27
Simple question (I hope),

When users enter text in the comments box, I want the ability to highlight and change some text to red (like in excel). Any idea how to do this?
I'm currently using the code: SomeControle.ForeColor = vbred
in the fore color box to keep the effect to only one cell (and not the whole column), but this changes all the text in the cell.

Any help would be appreciated.
Thanks.
 
First thing: always remember Excel is not Access; Access is not Excel. If you can do one thing in one then you shouldn't expect it to be possible in the other. They are for completely different purposes.

Yes, in Excel, you can perform a colour change to individual characters in a cell. In an Access cell you have no need to do this as the tables shouldn't be visible to the user.

But, by cell, I'm sure you mean a textbox on a form. Again, this is not directly possible with the default textbox object. You would have to install and register the rich textbox ActiveX control. I don't know if this ships with Access 2000 or 2002 but I haven't seen it in Access 97 - to be honest I've never went looking for it. I use it, however, when using Visual Basic 6 - it's a default control there.
 
Rich Text Control is available via the Developer Edition, or a third party such as FMS
 
EVP said:
Simple question (I hope),

When users enter text in the comments box, I want the ability to highlight and change some text to red (like in excel). Any idea how to do this?
I'm currently using the code: SomeControle.ForeColor = vbred
in the fore color box to keep the effect to only one cell (and not the whole column), but this changes all the text in the cell.

Any help would be appreciated.
Thanks.

Have you tried playing around with 'conditional formatting' on the 'format' tab? I have use it to hilite when something doesn't match the expected answer.
 
Re: Re: Change font color at whim

theatreman said:
Have you tried playing around with 'conditional formatting' on the 'format' tab? I have use it to hilite when something doesn't match the expected answer.

He means to perform actions wherby different characters can be off a different colour.
 
Any of you guys figured out how to do it. I need to do the same if it's possible. thanks.
 
mr moe said:
Any of you guys figured out how to do it. I need to do the same if it's possible. thanks.

Well:

Mile-O-Phile said:
You would have to install and register the rich textbox ActiveX control.

Rich said:
Rich Text Control is available via the Developer Edition, or a third party such as FMS

THAT's how you do it!
 
Ok I was able to use Rich Text Control, but the problem is when I try to show the value on a report, the report shows the code of the RTF and not the formatted value, how do I fix that. Any expert out there can tell me?
 
mr moe said:
the report shows the code of the RTF and not the formatted value

What code? You aren't using BBCode or HTML tags in it are you?

To use the rich text box you need to use its properties which I can't remember offhand but you are required to select areas of text using the SelStart and SelText properties and then assign formats to the selected text.
 

Users who are viewing this thread

Back
Top Bottom