By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,302 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,302 IT Pros & Developers. It's quick & easy.

Row level condition formating based on column value

P: 16
Hi,
I want the entire row color to change based on a column value in a report.

Foe example: Select Name,Age,Salary from table 1 -cretes 3 rows.

Name Age Salary
A 15 1000
B 25 2000
c 35 3000

First row should be in red if Salary column is less than 1001

Second row should be green if Salary column is less than 2001.

Third row should be orange if salary is less than 30001.
How to do conditional color formatting of the entire row in Msaccess2007. Please help
Dec 25 '11 #1
Share this Question
Share on Google+
11 Replies


Rabbit
Expert Mod 10K+
P: 12,421
You can set the background color of the detail section in the on render event.
Dec 25 '11 #2

100+
P: 759
Also you can take a look to this thread:
http://bytes.com/topic/access/answer...current-record
Dec 25 '11 #3

NeoPa
Expert Mod 15k+
P: 31,707
As far as I know Conditional Formatting only works on the field that's being checked, so the link Mihail provided is probably required for your need.
Dec 27 '11 #4

Narender Sagar
100+
P: 189
Dear NeoPa,
In Access 2010, Conditional Formatting can work for entire row based on value in a particular field. I am using this feature.
Dec 27 '11 #5

100+
P: 759
Hi Narender !
Can you tell me where is this feature in 2010 ?
Maybe it is also in 2007 but I don't know where to looking for.
Thank you !
Dec 27 '11 #6

Narender Sagar
100+
P: 189
Yes, you can try in 2007 also. Go to design view of your form. Go to Tab Format. Then select fields for which you want to maintain conditional formatting. Now comes the main thing : Click on "Conditional Formatting button on the ribbon. and then click new rule, then choose option : "Expression is". and type something like : [Order Type]="1" (where [Order Type] will be your particular field "Salary" value.)and choose desired color.
Then rest you must be knowing. Create more rules. And that's all.
Dec 27 '11 #7

NeoPa
Expert Mod 15k+
P: 31,707
Narender:
In Access 2010, Conditional Formatting can work for entire row based on value in a particular field.
Good for you Narender, and also for passing 100 posts :-)
Dec 27 '11 #8

100+
P: 759
Thank you for reply, Narender, but I think that here is something misunderstanding.

From baba first post I understand that he/she wish to set color for entire detail section in a form based on value in Salary field/bound control.

After Narender's reply I understand that in 2010 is a feature to do that.

Now, after Narender's last post (as reply to my question) I understand that in 2010 is a feature which allow to set a conditional format for one or more controls based on value from another control.

So, I am in fog (again I suspect my English):
First, which is the question for this thread ? To set entire detail section color or to set controls color for entire record ?
Second: Is it a feature, in 2010, to set color for detail section based on a value from one field/control or this feature can be used to set colors for controls.

Can someone synthesize that for me ?
Thank you !

PS
In 2007 I can't find a way to accomplish that tasks (no one).
Dec 27 '11 #9

Narender Sagar
100+
P: 189
Dear Mihail,
If you re-look the first post, the question is : He/She wants to change the color of entire row in a report, based on value under salary. So as you said, this option is not available in 2007, but this task can certainly be accomplished in Access 2010.
So as far as question for this thread is concerned, I think it is very much clear.
Dear NeoPa: Thanks.! (for appreciation !)
I just realized I made 100 Bytes..! :)
Dec 28 '11 #10

100+
P: 759
Oh, thank you, Narender.
In my had it was all the time a form.

Thank you, again !
Dec 28 '11 #11

Narender Sagar
100+
P: 189
Mihail, I am sorry, I didn't understand your last post correctly, however, conditional formatting can be set, similar way in forms also (of course in Access 2010) for sure.
Thanks..
Dec 28 '11 #12

Post your reply

Sign in to post your reply or Sign up for a free account.