Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report formatting (2003)

    I have 7 fields on a report : VisGainLoss, HealthGainLoss, SrGairLoss, DentalGainLoss, UCCIGainLoss, HMIGGainLoss, DavisGainLoss. I want to do the following:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me![VisGainLoss] = "Gain" Then (make the font color red) Or
    If Me![HlthGainLoss="Gain" Then (make the font color red) or etc

    I want to have the font red if any of the 7 fields have a gain. I wasn't sure how to code this.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Report formatting (2003)

    Try

    If Me.VisGainLoss = "Gain" Then
    Me.VisGainLoss.ForeColor = vbRed
    Else
    Me.VisGainLoss.ForeColor = vbBlack
    End If
    If Me.HealthGainLoss = "Gain" Then
    Me.HealthGainLoss.ForeColor = vbRed
    Else
    Me.HealthGainLoss.ForeColor = vbBlack
    End If
    ...

    (repeat for each field)

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report formatting (2003)

    Thanks Hans

Posting Permissions

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