Coloured fields for various values

saintsman

Registered User.
Local time
Today, 18:07
Joined
Oct 12, 2001
Messages
138
I am trying to get a certain colour displayed for different value ranges (a traffic lights system). Although I can get 3 colours displayed using basic code (and I am not an expert in this) I am unable to get it to work when using BETWEEN.
For example if I write the following I get a compile error which displays "expected then or goto":

If fieldname.value between 1 and 10 then
fieldname backcolor = 255
(255=the number for red)

Where am I going wrong?
Thanks in advance
 
Rich,
Thanks for the suggestion but it still does not work, although I can't fault your logic. When I write what you say I get a compile error looking for an expected expression before the <= symbols. I'm sure that I am doing something wrong. The code is written in an event procedure but I still can't figure out why something that should be so simple doesn't work.
 
Still no joy. It doesn't seem to like two expressions in the same "If" statement.
 
Rich,

At last!

Yes that finally worked. Thanks for all your assistance, It's much appreciated.

Saintsman
 

Users who are viewing this thread

Back
Top Bottom