Code to do conditional formatting

  • Thread starter Thread starter sc888ter
  • Start date Start date
S

sc888ter

I am forced to use Access 97 and do not have access to
conditional formatting. I am using a continous form and
want negative values to be red and positive to be black.
Can I place my code (If xxx < 0 then xxx.forcolor=vbred
else...) in some event that will work for each record.
Everything I have tried makes the item for each record
the color determined by the first item. Can I duplicate
the conditional formatting that works so well in 2000 and
xp?
 
I am forced to use Access 97 and do not have access to
conditional formatting. I am using a continous form and
want negative values to be red and positive to be black.
Can I place my code (If xxx < 0 then xxx.forcolor=vbred
else...) in some event that will work for each record.
Everything I have tried makes the item for each record
the color determined by the first item. Can I duplicate
the conditional formatting that works so well in 2000 and
xp?

What color do you want for Zero?
I believe the following will work in A97 ... without any coding!!!
Set the Property format of the control to:

# [Black];-# [Red];0 [Black]

See Access Help...
Format property + Number and Currency datatype
 
Back
Top