Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional formatting Font in textbox

Status
Not open for further replies.

jcglenn

Programmer
Aug 14, 2006
12
US
I have a report that sorts sales figure summarys by date and I would like to change colors for Sat and Sun. I tried using a iif statement in the font properties for the textbox.

I receive an error box stating my expression is not a valid color.

iif(datepart(dw,fields!reportdate.value) > 5, Blue, Black)


TIA for your help.

Craig
 
OK, part of my problem was I ommited the =

now...
=iif(datepart(dw,fields!reportdate.value) > 5, Blue, Black)

returns error...
The color expression for the textbox ‘ReportDate’ contains an error: [BC30451] Name 'dw' is not declared.

Can I not use datepart() here? if not, please suggest another way to change the font color for Sat and Sun.

thanks,
Craig
 
OK got all the kinks out. Works now that I got all the syntax right...

Had to create a new column to extract the Day of the week to get around using datepart() in the iif statement and had to use quotes around the colors.

=iif(fields!DOW.value = 1 or fields!DOW.value = 7, "Blue", "Black")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top