Setting Field Properties based on value

Hi,

Does anyone know whaty the function or code is to set a feild property. I have a Company Info box that shows the company Name. Eg “Cronus UK Ltd.” for the first company and “Test Company” for the other. I want to set the ForeColour feild to Red i.e 255 when it is “Cronus UK Ltd” and Blue 16711680 when it is “Test Company”.

I have a Global of GNAMEC for Company name, but can not find how to set a Feild Property. I tried this below but the ForecOlout feild only accepts Nos so I could not put GFORCOL in it.

IF GNAMEC = ‘Test Company’
THEN GFORCOL := 255;
IF GNAMEC = ‘CRONUS UK Ltd.’
THEN GFORCOL := 16711680;

Any ideas would be appreciated.

Thanks

Rory

Hi Rory,

You can set it in the ONFORMAT trigger for the control

e.g.

CURRFORM.Name.UPDATEFORECOLOR := GFORCOL;