Pull report values in VBA

  • Thread starter Thread starter cunger28
  • Start date Start date
C

cunger28

I have a list of fields that I'm pulling in to my report. Basically values
for Jan - Dec. For each month I would like to conditionally format the back
color depending on the value each month. Conditonal formatting in Access 07
only seems to allow 3 conditionals. I need more. I figured why not code it on
the form open command. Is this doable?

I thought I could do something along the lines of:
If Me!Jan.Value >= 90 Then
Me!Jan.BackColor = "#224422"
Else
If Me!Jan.Value < 90 Then
Me!Jan.BackColor = "#220011"
End If
End If

Whenever I try to preview I get a run time error of 2424. It doesn't like
the .Value portion of my code. If it matters at all, the report data is
being fed from a query and not a static table.

Thanks,
 
You should place code in the On Format event of the section containing the
controls. The color values should be long integers or constants like vbYellow.
 
Back
Top