Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with setall method
Message
 
To
26/04/2006 06:28:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01116579
Message ID:
01116594
Views:
14
>Hi everybody,
>I can't go out from this :
>I have 2 tables say TblA AND TblB. I set a relation from TblA into TblB.
>Now, I want to list TblA's records in a grid,highlighting those which have a correspondig record in TblB.
>What I did is :
>
>Mygrid.setall("DynamicBackColor","Iif(Eof('tblB'),Rgb(255,255,255),Rgb(255,210,210))","column")
>
>but I get a message telling me to use a valid expression for DynamicBackColor.
>What should I do to get rid of this message?
>Thank you very much
>Alessio

Alession,
This works for me:
oForm = CREATEOBJECT([Form1])
oForm.Show(1)

DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 250
    Width = 375
    DoCreate = .T.
    WindowState = 0
    Name = "Form1"


    ADD OBJECT grid1 AS grid WITH ;
        Height = 200, ;
        Left = 21, ;
        Top = 39, ;
        Width = 320, ;
        Name = "Grid1"

    PROCEDURE Load
        CREATE CURSOR crsTest2 (Fld1 I)
        INDEX ON Fld1 TAG crsTest2
        CREATE CURSOR crsTest (Fld1 I, Fld2 I, Fld3 I)

        FOR asd = 1 TO 20
            INSERT INTO crsTest VALUES (asd, -asd,asd * IIF(asd%2==0,1, -1))
            IF asd % 2 == 0
               INSERT INTO crsTest2 VALUES (asd)
            ENDIF
        NEXT

        SELECT crsTest
        SET RELATION TO Fld1 INTO crsTest2
        GO TOP
    ENDPROC


    PROCEDURE Init
        thisform.Grid1.SetAll([DynamicBackColor],[IIF(EOF("crsTest2"),RGB(255,0,0),RGB(255,255,255))],[Column])
    ENDPROC
ENDDEFINE
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform