Conditional Formatting

  • Thread starter Thread starter Mary Fetsch
  • Start date Start date
M

Mary Fetsch

In Access 2003, I had this code to apply conditional formatting to a field:

With GrownYrSeason.FormatConditions _
.Add(acExpression, acNotEqual, Nz(GrownYrYear.Value, "") <> "XXX")
.BackColor = RGB(230, 230, 230)
End With

I recently upgraded to Access 2007, and this code seems to work sometimes,
and other times I get this message:

Run-time error '7966':

The format condition number you specified is greater than the number
of format conditions.

I've tried this all different ways with no luck. Any ideas?

Mary Fetsch
 
If you use acExpression, acNotEqual is ignored. Try removing it and see
what happens.

Damon
 
Are you sure? I entered

GrownYrSeason.FormatConditions.Delete

above the code I sent you, and now my code is working.

Thanks for your response!
 
Back
Top