>Just wondering... is there a way to "color" rows when I'm browsing a table with an index set to one of the field's value? For example, I might have the following records in a table:
>
>Name__________________Item
>Laura Morgan....................basket
>Laura Morgan....................perfume
>Dave Jeffries......................tool set
>Dave Jeffries......................tennis balls
>Dave Jeffries......................golf club bag
>Ann Crouch.......................picture frame
>Pam Boyce.......................decorative soaps
>Linda Hopper.....................paint set
>Linda Hopper.....................table lamp
>
>I would want Laura's rows to be white, Dave's rows to be blue, Ann's row to be white, Pam's row to be blue, Linda's rows to be white, etc.
>
>Is this possible?
>
>Thanks,
>
>Alicia Bay for Joe Pawlowski
SetAll('DynamicBackColor' ;
"iif(myTable.Name = 'Laura Morgan', 0xFFFFFF, "+;
"iif(myTable.Name = 'Dave Jeffries', 0xFF0000, "+;
...)
However you can see how complex it might get quickly. Instead you might create a method that'd return you the color. Then setall() looks like:
SetAll('DynamicBackColor',"(thisform.GimmeColor(myTable.Name))")
In GimmeColor you can check the name and return the color you want. Yet another easy way would be to have an array or cursor to supply colors. ie:
select distinct name, 0xFFFFFF as Color from myTable into cursor myColors readwrite
browse
index on name tag name
select myTable
set relation to name into myColors
SetAll('DynamicBackColor',"(myColors.Color)")
Cetin