Conditional formatting of text box

Hi Experts,

My problem is over a simple feature, this is embarassing to even seek help for...

I'm using Crystal Reports 8.5 on W2K OS.  When I conditionally format a text box background to silver, the entire text box background becomes black, even if the condition is not met!!!  I'm using Basic Syntax and the formula in the condition is:

If {ado.x} <> {ado.y} Then
    Formula = 1 'True    
Else
    Formula = 0 'False
End if

FYI:  Both {ado.x} and {ado.y} are not null fields.

Looking forward to your replies! Thanks!
MariaHaltAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
You should be returning the color

If {ado.x} <> {ado.y} Then
    Formula = crSilver'True    
Else
    Formula = crWhite 'False
End if

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MariaHaltAuthor Commented:
Really?  I didn't think to specify the color in the Formula since I had already chosen the color from the combo box.  I thought I was just looking for a True or False to the condition:  If true use chosen color, if false use default color.  Anyway, it works.  Thank you.
0
mlmccCommented:
I hope I got the colors names close.

Glad I could help

mlmcc
0
pchakCommented:
I was happy to see the color issue, but how does that apply to label suppression.
I'd like to suppress some fields/labels based on the parameter.

If the region is "RMAP", suppress the label.

dim sTrue as boolean
if {?sRegion} = "RMAP" then
sTrue =true
else
sTrue =false
end if
formula = sTrue

What's wrong?
thanks,
pchak
0
mlmccCommented:
It is customary to ask your own questions.

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.