MS ACCESS 2010 ? VBA code to pull the background color from one field in a table and apply it to a row in an MS ACCESS FORM?
We would like to highlight a row in an MS ACCESS form based on a value in a column.
We'd like to keep the background color in a separate table and use the value in the form column to look up the corresponding background color and then apply it to all the rows that are in the form that have the corresponding value in the specified column.
Create a continuous view form.
Move all the control close to each other, so that they touch on all sides.
In design view, ...select all the controls on the detail section (The "Row"), while holding down the Shift key.
Then click: Format-->Conditional formatting
Click: New Rule
Enter something like: Expression is [YourField]=3
Then set the Background color to whatever you like.
Click Apply, ...then click OK
Save the form
Re-open the form
Simple screenshot and sample DB attached.