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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASE Statement to set background colour

Status
Not open for further replies.

bill1357

Programmer
Oct 3, 2001
1
US
Hi All,
does anyone know the format of a case statement to set the background colour of a page heading.

I'm trying something like... (the actual code's st work)

Select Case {field name}
Case "R"
crRed
Case "G"
crGreen
Case Else
crWhite
End Select

but it complains about 'missing end statement'

TIA

Bill
 
In crystal you can format the colour for a header section using a formula. ie.

Right click on your header section...
Format section...
Select Colour Tab...
Formula box...

If (expr_1) then red
else if (expr_2) then green
else blue

Hth,
Geoff
 
As FoxG says you must use if-else blocks to do what you want
Select-case will not work in this formula...or any formula regarding conditional property selection
 
This appears to work

Select Case {V_CRYSTAL_SCHWAB01.TABLE_STATUS}
Case "OBSOLETE"
formula = Color (254,120,120 )
Case "MBO"
formula = Color (254,184,250 )
Case Else
formula = crWhite
End Select

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top