FormatConditions

N

Norbert Meiss

I try to set conditional formatting for a control in a continous form with
the following VBA code (Access 2007):
With Me
With .ADD_Status
.FormatConditions.Delete
.FormatConditions.Add acExpression, , "ADD_Status = 0"
.FormatConditions.Add acExpression, , "ADD_Status = 1"
.FormatConditions.Add acExpression, , "ADD_Status = 2"
.FormatConditions.Add acExpression, , "ADD_Status = 3"
.FormatConditions.Add acExpression, , "ADD_Status = 4"
....
In the last line shown I get the error 7966. I thought, conditional
formatting ist not limited to 3 or 4 when using VBA code. What is going wrong?
TIA, Norbert
 
L

Linq Adams via AccessMonster.com

Sorry, you're to the Default plus three conditions, whether doing it thru the
Format Menu or VBA code.

If you're using a Single View form, you can use code in the Form_Current
event and do "conditional formatting," with a little "c" and a little "f" to
your heart's delight!

For Continuous or Datasheet forms, the only conditional formatting you can do
and thru code and exceed the Default + 3 conditions is if you're setting the
Locked Property with multiple conditions. If the field in the current record
is Locked, for instance, the field in all records are Locked, but you can't
really tell, as no change in appearance occurs. WHen you move to another
record, the field changes depending on that record's conditions.
 

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

Similar Threads


Top