text box color (1 Viewer)

bigmac

Registered User.
Local time
Today, 15:28
Joined
Oct 5, 2008
Messages
295
hi all. is it possible to change the color of the text in a text box
eg normal text is black but i want to change this particular text in this text box to red then by right clicking it will come up with the text color picker?
i want to do this because some of the text will be exactly the same in the text box depending on the record( text box 1 contains " fun" in black, but in record 2 text box 1 contains " fun" but in red .
hope this makes sense , if this is possible can you show me in a sample please:confused:
 

isladogs

MVP / VIP
Local time
Today, 23:28
Joined
Jan 14, 2017
Messages
18,216
Yes and you'll be pleased to know its easy to do.
You can change text colour (fore color) & style & also the background colour (back color)

In design view, right click on the textbox you want to format then click Properties
A property sheet appears similar to this
I've highlighted some of the items you may wish to modify



You can also do several controls at once in the same way by hlding the control key while you select them.

You can also use conditional formatting (Format ribbon) to modify the appearance of controls when certain conditions are met. For example:



All the above applies to forms & reports.
See attached for two traffic light items with a lot of colour (possibly too much) as examples
 

Attachments

  • conditional format.PNG
    conditional format.PNG
    11.1 KB · Views: 468
  • PropertySheet.PNG
    PropertySheet.PNG
    25.1 KB · Views: 478
  • Form.jpg
    Form.jpg
    96.3 KB · Views: 89
  • Report.PNG
    Report.PNG
    62.7 KB · Views: 86

bigmac

Registered User.
Local time
Today, 15:28
Joined
Oct 5, 2008
Messages
295
hi ridders thank you for the reply, but this will only work on all texts in the the box, what i am after is to change the text color for individual text box's what i am trying to say is this , i have a text box called text1, and in it i will be putting the names of people , if for example i have 6 people called tom then i would like only to change the color of the text on some of them and not all, this i think will have to be done by a new menu when i right click i think, unless i can activate the text color picker by adding it to the textbox right click menu, this way i can change the color of individual boxes even if they have the same value
 

isladogs

MVP / VIP
Local time
Today, 23:28
Joined
Jan 14, 2017
Messages
18,216
Hi

What I described can be done for one textbox or for many
However all of the text in any one textbox has to be the same colour

If you have 6 Toms and only 4 of them should be red Toms then you need to have a condition that applies to those 4 but not the other two

If you want to produce more colourful effects, you can do so using rich text (effectively the same as HTML) but its more tricky to implement



For more info, see the Customised Message Forms' section of my 'attention seeking' database

https://www.access-programmers.co.uk/forums/showthread.php?t=295342

Don't overdo the colours - you can produce some truly horrible results
 

Attachments

  • richtext.PNG
    richtext.PNG
    22.9 KB · Views: 454

Mark_

Longboard on the internet
Local time
Today, 15:28
Joined
Sep 12, 2017
Messages
2,111
hi all. is it possible to change the color of the text in a text box
eg normal text is black but i want to change this particular text in this text box to red then by right clicking it will come up with the text color picker?
i want to do this because some of the text will be exactly the same in the text box depending on the record( text box 1 contains " fun" in black, but in record 2 text box 1 contains " fun" but in red .
hope this makes sense , if this is possible can you show me in a sample please:confused:

It sounds like you want to save your text in RTF format.

To do so, in the table you would need to have your field be a Long Text. On the fields General Properties make sure that Text Format is Rich Text. Let me know if this is what you are trying to do or if you wanted the program to choose what color text shows up as.
 

bigmac

Registered User.
Local time
Today, 15:28
Joined
Oct 5, 2008
Messages
295
Hi mark this did not work mate, thank you, I have gone down the conditional format route and added another field yes/no to decide on the colour
 

bigmac

Registered User.
Local time
Today, 15:28
Joined
Oct 5, 2008
Messages
295
just a thought, how would you use conditional formatting on a text box that contains the following [345/787] and only change the color of the text or numbers before the / sign
 

Mark_

Longboard on the internet
Local time
Today, 15:28
Joined
Sep 12, 2017
Messages
2,111
Two options...
1) Make it a rich text field (allows you to save different colors on each part since it is rich text)
2) Have different fields.

Normal text box does not allow for different colors on part of the text because it is considered "Plain Text" (i.e. unformatted).

Think the difference between something done in WORD and NOTEPAD. WORD is rich text normally and NOTEPAD is plain text ONLY.
 

isladogs

MVP / VIP
Local time
Today, 23:28
Joined
Jan 14, 2017
Messages
18,216
For the rich text approach, did you look at the link & example that I provided in the earlier post?
 

Users who are viewing this thread

Top Bottom