Conditional Formatting of a label on a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Desitech
    New Member
    • Apr 2009
    • 56

    Conditional Formatting of a label on a report

    I have a Label on a report with a check box from a table indicating True or False. I would like to have the labels that are true to highlight yellow using conditional foramtting. The False labels to remain unhighlighted. I have tried changing the label to a text box and then conditional formatting "Expresion Is" "BILL"=TRUE . But the formatting is not working. I loose my Label text and BackColor does not change. Any Suggestions?
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    Try changing "BILL" to [BILL].

    Comment

    • Desitech
      New Member
      • Apr 2009
      • 56

      #3
      That worked to get my background highlighted. But because I have to change the label to a txtbox, in order to conditianally format it, the label text is gone. How can I gat the label text to come back?

      Comment

      • ChipR
        Recognized Expert Top Contributor
        • Jul 2008
        • 1289

        #4
        You can set the control source of the text box (in properties or by typing into the box) to
        Code:
        = "Label Text"
        You do need to type in the equals sign.

        Comment

        • Desitech
          New Member
          • Apr 2009
          • 56

          #5
          Great....That did it. Thanks for all your help.

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            Originally posted by Desitech
            I have a Label on a report with a check box from a table indicating True or False. I would like to have the labels that are true to highlight yellow using conditional foramtting. The False labels to remain unhighlighted. I have tried changing the label to a text box and then conditional formatting "Expresion Is" "BILL"=TRUE . But the formatting is not working. I loose my Label text and BackColor does not change. Any Suggestions?
            In the Detail Event of the Report, try something similar to:
            Code:
            Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
            If Me![<Check Box Name>] Then
              Me![<Label Name>].ForeColor = vbYellow
            Else
              Me![<Label Name>].ForeColor = vbBlack
            End If
            End Sub

            Comment

            Working...