Background Row Colour on SubForm

DubaiDave

Registered User.
Local time
Today, 18:31
Joined
Nov 25, 2008
Messages
69
Christmas Greetings All!

I have a subform generated from a query and I would like to change the background colour of the a row (recordset) dependent on the value in one cell.

How do I go about that?

Dave
 
Have you tried Conditional Formatting (Format/Conditional Formatting)?
 
Have you tried Conditional Formatting (Format/Conditional Formatting)?

No, but I was under the impression that would work for the field only and not the recordset (the same as excel).

I will have a look now.

David
 
Paul,

I have applied conditional fromatting, but it changes that 'cell' only. How do I go about formating the whole row?

Cheers

Dave
 
You can apply the same rule to all the controls, or put a single empty textbox behind all of them and apply the format to that, with the other controls transparent.
 
I don't understand how I can apply the rule to the rest of the recordset. Say Column 1 is Open or Closed and the remaining columns are something else. How can I tell Column 2 to have a red background if column 1 = Open?

Dave
 
...put a single empty textbox behind all of them and apply the format to that, with the other controls transparent.

You could only do that with a Continuous View form, not on a Datasheet View form, which most subforms are. You could always use a Continuous View form tweaked to look like a Datasheet.
 
Would it be better to do it in code triggered by an on enter event for the subform?

David
 
I don't understand how I can apply the rule to the rest of the recordset. Say Column 1 is Open or Closed and the remaining columns are something else. How can I tell Column 2 to have a red background if column 1 = Open?

Dave

Use Expression Is instead of Field Value Is so you can format one control based on another. Then your expression would be something like:

[Column1] = "Open"
 

Users who are viewing this thread

Back
Top Bottom