tv=left(allt(this.value),3) >do case >case len(tv)<3 > this.forecolor=rgb(255,255,255) >case tv='AAA' > this.forecolor=rgb(255,255,128) >case tv='BBB' or tv='CCC' > this.forecolor=rgb(255,0,0) >endcaseYou should use DynamicForeColor in grid for that. You can also set it all by putting something like the following in your Grid's Refresh code:
*** assuming the record value is named mytable.myval This.SetAll("DynamicForeColor","iif(len(mytable.myval)<3,rgb(255,255,255),iif(mytable.myval='AAA',rgb(255,255,128),rgb(255,0,0)))"Of course, you could do the same with DynamicBackColor for the backcolor, etc...