In the OnFormat trigger of "Sell-to customer no." :
if "Location Code" = 'BLUE' then
Currform."Sell-to Customer No.".UpdateForeColor(255)
else
CurrForm."Sell-to Customer No.".UpdateForeColor(255*256) ;
Btw, in this case i would make a new field in the location table to store the color you want, and retrieve that in the above code. That way you don't have to use any magic numbers/codes. The code ( stil in the OnFormat trigger ) would then become something like :
if not Location.get("Location code") then
Location.init ;
CurrForm."Sell-to customer No.".UpdateForeColor(Location."Customer Color" ;
I have made a function for it in almost all databases we have here, so i can just use the Red, Green and Blue values :
RGB ( R : Integer, G : Integer, B : Integer ) : Integer
if R < 0 then R := 0 ;
if R > 255 then R := 255 ;
if G < 0 then G := 0 ;
if G > 255 then G := 255 ;
if B < 0 then B := 0 ;
if B > 255 then B := 255 ;
Exit( R + ( G * 256 ) + ( B * 256 * 256 ) ) ;
Comments
Btw, in this case i would make a new field in the location table to store the color you want, and retrieve that in the above code. That way you don't have to use any magic numbers/codes. The code ( stil in the OnFormat trigger ) would then become something like :
can u plz tell me how to pick this color code
As Also seen here:
viewtopic.php?f=5&t=42489
& another:
http://www.mibuso.com/dlinfo.asp?FileID=1055
all your color needs will be met by these few posts :thumbsup:
http://www.BiloBeauty.com
http://www.autismspeaks.org