Conditional Formatting in reports-5 Conditions

G

Guest

I need some help with formatting a field in a report based on a cross-tab
query. I am not very good at code so bear with me. I am currently using the
conditional formatting, but have one additional criteria. The field I need
to format in the report shows audit results. I need one color (default) for
blank/audit not due yet, then the conditional formatting changes to green if
the results are 95% or greater, yellow for 94%-90%, and red for below 90%. I
need one more color to represent that the results are not required for the
particular facility. I want to base this on another field being populated,
the audit received field. If the audit received field has a date, but the
results field is blank, I want the report to show dark blue in the results
field.

Is this possible?
 
G

Guest

In the DETAIL section of the VBA code for the report:

Select Case myIndicator
Case 1 ' Not due yet
me.displayFieldName.backcolor = someValueOfYourChoice
Case 2 ' >= 95%
me.displayFieldName.backcolor = someOTHERValueOfYourChoice
Case 3 ' 90-94%
me.displayFieldName.backcolor = someOTHERValueOfYourChoice
Case 4 ' < 90%
me.displayFieldName.backcolor = someOTHERValueOfYourChoice
End Select

Now I used simple single-numbers as an "indicator" for the requested values,
but you can replace those with the actual values and/or ranges that you want.
The important thing to note here is the actual syntax. for changing the
colors and determining which colors to choose. Armed with this information
and the Visual Basic Help facility, you should be able to resolve the issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top