Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: textbox font color dependent on check box

    i have a report which i need to make certain results displayed in Red, if there is a check in the box.

    example:

    my report is called OEEModel
    on the form i have a chkbox - called "FailureModeInPlace"
    i also have 2 text boxes called "EventCode" and "CodeDescription"

    what i want to do is for each record that is displayed with a chkbox ticked that the font in the two boxes turn red and bold...

    can this be done please if so...how

    cheers

    Andy

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    it could not be done, because the properties of the textboxes in a report cannot be altered at runtime, and they have no event possibilities.
    Last edited by emiel; 10-25-04 at 10:16.

  3. #3
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    How about something like the following in the Detail_Format() section of your report:
    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
        If FailureModeInPlace = True Then
            EventCode.ForeColor = vbRed
            EventCode.FontWeight = 700
            CodeDescription.ForeColor = vbRed
            CodeDescription.FontWeight = 700
        Else
            EventCode.ForeColor = vbBlack
            EventCode.FontWeight = 400
            CodeDescription.ForeColor = vbBlack
            CodeDescription.FontWeight = 400
        End If
    
    End Sub
    that should turn your font red and bold when the box is checked and black and normal when the check box is unchecked. Hope it helps. have a great day.
    p.s. i'm using Access 2000
    Last edited by jmahaffie; 10-25-04 at 13:21.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    right click -> conditional formatting -> "=1"
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •