Conditional formatting of text box

Posted on 2004-11-03
Last Modified: 2008-03-17
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    
    Formula = 0 'False
End if

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

Looking forward to your replies! Thanks!
Question by:MariaHalt
    LVL 100

    Accepted Solution

    You should be returning the color

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


    Author Comment

    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.
    LVL 100

    Expert Comment

    I hope I got the colors names close.

    Glad I could help


    Expert Comment

    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
    sTrue =false
    end if
    formula = sTrue

    What's wrong?
    LVL 100

    Expert Comment

    It is customary to ask your own questions.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now