Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting grid rows
Message
 
To
20/02/1998 11:08:59
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00080119
Message ID:
00080121
Views:
23
Jerry,

It looks like l_User is going out of scope. The variable disappears as soon as the command button Click() method completes. When the grid columns try to reevaluate the DynamicBackColor, the variable's gone. It would be better to add a property to your form (let's call it l_User) and do this:

THISFORM.l_user = "Bob"
myGrd.SetAll("dynamicbackcolor", ;
"IIF(myfield = THISFORM.l_User, RGB(255,0,0), RGB(255,255,255))", "Column")


>I am trying to hightlight some grid rows so the user can highlight just his records.
>
>The first example works, the second doesn't.
>This code is in a Command button click()
>
>Example 1:
>myGrd.SetAll("dynamicbackcolor", ;
>"IIF(myfield = 'Bob', RGB(255,0,0), RGB(255,255,255))", "Column")
>***Works
>
>Example 2:
>l_user = "Bob"
>myGrd.SetAll("dynamicbackcolor", ;
>"IIF(myfield = l_user, RGB(255,0,0), RGB(255,255,255))", "Column")
>***Gives a error.
>
>
>How can I get example 2 to work.
>
>Thanks,
>
>Jerry Tovar
Previous
Reply
Map
View

Click here to load this message in the networking platform