Conditional Formatting from a Table (1 Viewer)

MattBaldry

Self Taught, Learn from the Forums
Joined
Feb 5, 2019
Messages
310
Hi all,

Is there a quick way of creating a conditional formatting style method but with the options added/selected in a table.

We have 4 production cells, and each are assigned a colour. At the moment I have created conditional formatting rules to change the colour on my continuous form. What I would like would be to be able to use a table to add new Cells and colours or change existing ones.

~Matt

1716462455323.png


1716462593988.png
 
I would be surprised if you could apply conditional formatting to a field at the table level, after all, tables are for storing data, not for viewing.
 
You can use vba to set conditional formatting referencing a table or if the control is a text box you can use sql to create a rich text field in your form recordsource formatted how you require although that does relate more to the text rather than a control back colour

with regards your second image, create an unbound text box sized to the detail section and send to back. You then only need to conditionally set this control, not all of them
 
You can use vba to set conditional formatting referencing a table or if the control is a text box you can use sql to create a rich text field in your form recordsource formatted how you require although that does relate more to the text rather than a control back colour

with regards your second image, create an unbound text box sized to the detail section and send to back. You then only need to conditionally set this control, not all of them
Thanks CJ,

I did think of this, but on some of them I need to change the font colour to white, so it is not just the background of the text boxes. I will have a look into it though and see if I can always leave the text in 1 colour.

The current record is highlighted black with white text, and some of the others also need white text to be clearly seen by us colour blind people :(

~Matt
 
See demo, does exactly that. This stores the background colors in a table for a category and creates the format condition. Simply add an new forecolor field in the table. Should require just two additional lines of code to be able to dynamically add and modify your format conditions from the table.

You can disregard the discussion on the onpaint event and focus on the adding and removing format conditions.
 
With respect to colours I always found white forecolours hard to use. I ended up using black on yellow and black on cyan predominantly. One issue is there are very few vbcolour constants that are available. So vbYellow and vbCyan were ok, but not much else. I didn't like white on blue, red or green. Maybe better monitors make a difference.
 
When I was using a DOS command window, I used to prefer yellow on blue.
 

Users who are viewing this thread

Top Bottom