Normal Topic Subform individual cell color (Read 459 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Subform individual cell color
Nov 16th, 2010 at 2:08pm
Print Post Print Post  
While in the parent form, is it possible to have a subforms individual cell change the background color just for that cell if it meets certain criteria?  For example, if one of the cells contains a negative number I want that cell only to have a red background.

Thanks,

Brandon
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Subform individual cell color
Reply #1 - Nov 16th, 2010 at 3:09pm
Print Post Print Post  
Yes.

To conditionally set the background color for a cell based on values, put something like the following in the On Draw event for the cell:
Code
Select All
if(population > 1000000)
{
	RGBColor(City, 0, 0, 0, 255, 0, 0)
}
else
{
	RGBColor(City, 0, 0, 0, 255, 255, 255)
}
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: Subform individual cell color
Reply #2 - Nov 16th, 2010 at 3:16pm
Print Post Print Post  
Perfect!

Thank you!
  
Back to top
IP Logged