Hi James,
You'll need to base the condition on the underlying fields. Create a switch method on your form and add the following code (substituting the actual field names of course):
lRetVal = ! empty(<i>myfield1</i>) and empty(<i>myfield2</i>)
Return lRetVal
You can put the SetAll method calls for the grid in the Init event of the form:
WITH THISFORM.GRID1
.SETALL("DYNAMICforeCOLOR","IIF(<b>ThisForm.switch()</b>,RGB(255,255,255),RGB(0,0,0))","column")
.SETALL("DYNAMICbackCOLOR","IIF(<b>ThisForm.switch()</b>,RGB(255,0,0),RGB(255,255,255))","column")
ENDW
Hope this helps!
>I want to be able to change the row color to red in the grid...
> if alltrim(thisform.grid1.column1.text1.value)<>"" and thisform.grid1.column2.combo1.value ="". then switch=.t.
>
>WITH THISFORM.GRID1
> .SETALL("DYNAMICforeCOLOR","IIF(switch,RGB(255,255,255),RGB(0,0,0))","column")
> .SETALL("DYNAMICbackCOLOR","IIF(switch,RGB(255,0,0),RGB(255,255,255))","column")
>ENDW
>THISFORM.GRID1.REFRESH
>
> I am not sure where to put the code and how to make it work. I turned a row red if a check box was true, but the same logic isn't working. Also, if there is a better way to do this, I would want to know.
>
>TIA,
>Jim
kenweber
GCom2 Solutions
Microsoft Certified Professional