Is there a way to set the background color of a cell based on a field in my
results query? I have a field named "Priority" and I would like the cell
background color to be "yellow" if the field value = "2" and green if it's
value ="1" and red if it's value ="0". Can this be done in a results based
query page?

If so can someone help me because I am new to web pages, and I am not sure
how to do this or if thereâ??s a site that I could get help from please let me
know.

Re: Cell Colors by Stefan

Stefan
Sat Sep 03 05:44:37 CDT 2005

Only if you are hand coding your ASP (VBscript) results and not using the DBRW

If you now have say
<td><%=Priority%></td>

You would need to set the color using a Case statement (inside of each row)
Where Priority is a number from your DB objRS

<%
Priority = Cint(objRS("Priority"))
Select Case Priority
Case 2
strColor = "bgcolor='yellow'"
Case 1
strColor = "bgcolor='green'"
Case 0
strColor = "bgcolor='red'"
Case Else
strColor = "bgcolor='blue'"
' Some default color for other than 0,1,2
End Select
%>

And then apply it using

<td <%=strColor%>><%=Priority%></td>--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"hrider1@comcast.net" <hrider1comcastnet@discussions.microsoft.com> wrote in message
news:42FAFA08-7553-4B7B-AE17-94737086BB55@microsoft.com...
| Is there a way to set the background color of a cell based on a field in my
| results query? I have a field named "Priority" and I would like the cell
| background color to be "yellow" if the field value = "2" and green if it's
| value ="1" and red if it's value ="0". Can this be done in a results based
| query page?
|
| If so can someone help me because I am new to web pages, and I am not sure
| how to do this or if thereâ??s a site that I could get help from please let me
| know.
|



Re: Cell Colors by Stefan

Stefan
Wed Sep 07 06:36:26 CDT 2005

Did you see my response to your other post (in the client newsgroup) where I provided you the detailed info on how to do it w/ the
DBRW and with your DBRW field names"

The error you are getting is because my above post was IF you were Not using the DBRW
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________

| "hrider1@comcast.net" <hrider1comcastnet@discussions.microsoft.com> wrote OFFLINE
| .......
| I keep getting a error saying:
| Error Type:
| Microsoft VBScript runtime (0x800A000D)
| Type mismatch: 'objRS'
| /logistic/Default.asp, line 69
|



"Stefan B Rusynko" <sbr_enjoy@hotmail.com> wrote in message news:eBdm8RHsFHA.3452@TK2MSFTNGP14.phx.gbl...
| Only if you are hand coding your ASP (VBscript) results and not using the DBRW
|
| If you now have say
| <td><%=Priority%></td>
|
| You would need to set the color using a Case statement (inside of each row)
| Where Priority is a number from your DB objRS
|
| <%
| Priority = Cint(objRS("Priority"))
| Select Case Priority
| Case 2
| strColor = "bgcolor='yellow'"
| Case 1
| strColor = "bgcolor='green'"
| Case 0
| strColor = "bgcolor='red'"
| Case Else
| strColor = "bgcolor='blue'"
| ' Some default color for other than 0,1,2
| End Select
| %>
|
| And then apply it using
|
| <td <%=strColor%>><%=Priority%></td>--
|
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| "Warning - Using the F1 Key will not break anything!" (-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
| "hrider1@comcast.net" <hrider1comcastnet@discussions.microsoft.com> wrote in message
| news:42FAFA08-7553-4B7B-AE17-94737086BB55@microsoft.com...
|| Is there a way to set the background color of a cell based on a field in my
|| results query? I have a field named "Priority" and I would like the cell
|| background color to be "yellow" if the field value = "2" and green if it's
|| value ="1" and red if it's value ="0". Can this be done in a results based
|| query page?
||
|| If so can someone help me because I am new to web pages, and I am not sure
|| how to do this or if thereâ??s a site that I could get help from please let me
|| know.
||
|
|