This topic is locked

Conditional Row colour based on single value

4/30/2008 1:56:57 PM
ASPRunnerPro General questions
Stu author

One field in my records will be set to -1 to indicate this record has a special attribute and I want it to display with a different background and font colour.
I'd also like to prevent the data in this record from being edited while all other record may be edited.
I've seen the examples in Tip & Tricks but they change colour based on the value of each cell individually. I'd like to apply to the whole row in one action.
Thanks,
Stu

Stu author 5/1/2008

http://www.asprunner.com/forums/index.php?showtopic=6412


Sergey,
Thanks for the link. As a new user unfamiliar with variable objects at this moment I don't know how to write the "If" statement that lets me use that one line row setter. Suppose the field in my record was called "ThisLineAreLabels" would you just write me the "If" statement - or point me to a good page on how to address record fields. Believe it or not I write masses of code in Access VB and can make Access do somersaults. I just need a push for ASPRunner.
Best Regards,
Stu

Sergey Kornilov admin 5/1/2008

I don't have enough info to help you with this.
Post your application to Demo Account and send the URL to support@xlinesoft.com.

Stu author 5/3/2008

I don't have enough info to help you with this.

Post your application to Demo Account and send the URL to support@xlinesoft.com.


Sergey,
This is solved now. It was a single quote that was needed in the statement.
Regards,
Stuart

N
nitescan 5/22/2008

Stuart,
Would you mind posting your IF statement so that I can accomplish the same task? I've been looking everywhere for an example that uses the variables and am stuck.
Thanks,

Nitescan

Stu author 5/23/2008

Stuart,

Would you mind posting your IF statement so that I can accomplish the same task? I've been looking everywhere for an example that uses the variables and am stuck.
Thanks,

Nitescan


Certainly,
if rs("Seq")=-1 then

row("shadeclass")="style='background:yellow'"

end if
In the Sub BeforeMoveNextList(rs,row,col) event
Note that depending on the format of your test field you might need to change it to <>0. I seem to remember I had to do that in an other project to get it to work. Of course "Seq" is MY field name that I am testing.
look VERY closely at the quote marks! Note the double quote at the end
Good Luck
Stu

N
nitescan 10/1/2008

Thanks Stu! That helped a lot. What about font color? Where you able to get that changed as well? For rows that I'm coloring red, I'd prefer white text so it's easier to read.