Conditional Formating for a report in MS Access

I want to set a conditional formating in ms access for a feild based on 2 other fields value.

For example:

NAME feild to be GREEN when FEILD1 and FEILD 2 are both .80 or greater.
NAME feild to be YELLOW when either FEILD1 or FEILD2 are bettween .40 or higher
NAME feild to be RED when either either FEILD1 or FEILD2 are lower than .40
jfs9900Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zgilboaCommented:
Hello,

1. Open the report in design view.

2. Select the control you would like to have a conditional formatting.

3. From the menu bar, click on FORMAT, then select CONDITIONAL FORMATTING.

4. (The top formatting section is the default format for that control).

5. (The second formatting section is used for your first criteria...)

6. Click on the combo-box where it says ""Field Value Is" -- select "Expression Is" instead.

7. The expression box will be opened.  Type:
    ([Field1]>=0.80) And ([Field2]>=0.80)

8. Then chosse colors, fonts, etc... there is a text box that reflects your choices.

9. At the very bottom on that section, click on "Add>>"

10.  Following steps 6 through 8, add any additional criteria that is required.

Cheers,
Zvi

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dmitryz6Commented:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
     If Me.FEILD1 >= 0.8 Or Me.Test_Data Me.FEILD1 >=0.8 Then
            Me.Test_Data.BackColor = VBGreen
        ElseIf (Me.FEILD1 between 0.4 and 0.8) Or (Me.FEILD1 between 0.4 and 0.8 )Then
            Me.Test_Data.BackColor = VBYELLOW
ElseIf Me.FEILD1 <0.4 Or Me.FEILD1 <0.4 Then
            Me.Test_Data.BackColor = VBred
        Else
            Me.Test_Data.BackColor = vbwhite
        End If



End Sub
mbizupNerdCommented:
In design view, select the Name Field
Format -> Conditional Formatting

Under Condition1, select "Expression Is"
in the textbox, type "FEILD1 >= .8 AND FEILD 2 >= .80 "
Select green for fill color

Click ADD

Under Condition2, select "Expression Is"
in the textbox, type "FEILD1 >= .4 AND FEILD1<.80 AND FEILD2 >= .4 AND FEILD2<.80"
Select Yellow for fill color

Click ADD

Under Condition2, select "Expression Is"
in the textbox, type "FEILD1 <.4 AND AND FEILD2<.40"
Select Red for fill color
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.