coloured text within the same text box

monplankton

Registered User.
Local time
Today, 02:31
Joined
Sep 14, 2011
Messages
83
Hi has anyone ever used VBA to enter text into a text box with sections of the text in different colours and return to the next line? for example.

On the enter date we went to look at a problem.
When we arrived it was enter time.
The problem was related to enter part description.

I'm currently using access 2003.

Thanks for any help or ideas.:)
 
As far as I know, in A2003, the fore color property applies to the entire textbox. So, I don't think it is possible to have multiple colors within the same textbox. In so far as the multiple lines, that is possible. For example on a form, in vba:

dim st1 as string
st1 = "First Line" & vbCRLF & "Second Line" & vbCRLF & "Third Line"
Me![textbox] = st1

this should populate the textbox (after height adjustment or setting the can grow property to true) as follows:
First Line
Second Line
Third Line

Hope this helps,

Jim
 
Have a text stored in a memo field in a table. Set the property of that field to Rich Text. In textbox bound to that field (and also set to RichText), prepare your text. Insert one or more placeholders and colour them as desired. Replace the placeholders with actual data, using the Replace function. If you have a2007/a2010. With A2003 I am not sure what you can do.

Update: Reading the full text is normally something I advise others to do:banghead:

If you want freeeflowing text then I don't know - otherwise as ketbdnetbp wrote, one textbox per coloured item.
 
Last edited:
For A2003, you would need to purchase an add-on control such as the one sold by www.fmsinc.com.

For A2007, the control is included.

I believe the FMS control uses RTF notation but the A2007 control uses HTML
 

Users who are viewing this thread

Back
Top Bottom