Row level condition formating based on column value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baba
    New Member
    • Nov 2011
    • 16

    #1

    Row level condition formating based on column value

    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
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can set the background color of the detail section in the on render event.

    Comment

    • Mihail
      Contributor
      • Apr 2011
      • 759

      #3
      Also you can take a look to this thread:

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        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.

        Comment

        • Narender Sagar
          New Member
          • Jul 2011
          • 189

          #5
          Dear NeoPa,
          In Access 2010, Conditional Formatting can work for entire row based on value in a particular field. I am using this feature.

          Comment

          • Mihail
            Contributor
            • Apr 2011
            • 759

            #6
            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 !

            Comment

            • Narender Sagar
              New Member
              • Jul 2011
              • 189

              #7
              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 "Conditiona l 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.

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32669

                #8
                Originally posted by Narender
                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 :-)

                Comment

                • Mihail
                  Contributor
                  • Apr 2011
                  • 759

                  #9
                  Thank you for reply, Narender, but I think that here is something misunderstandin g.

                  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).

                  Comment

                  • Narender Sagar
                    New Member
                    • Jul 2011
                    • 189

                    #10
                    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..! :)

                    Comment

                    • Mihail
                      Contributor
                      • Apr 2011
                      • 759

                      #11
                      Oh, thank you, Narender.
                      In my had it was all the time a form.

                      Thank you, again !

                      Comment

                      • Narender Sagar
                        New Member
                        • Jul 2011
                        • 189

                        #12
                        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..

                        Comment

                        Working...