Results 1 to 2 of 2
  1. #1
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    Change as per condition font color

    Hi,
    I have below code its not work
    I want when remain is value zero font green
    when remain value is less than zero i want font color for remain with red
    when its bigger than zero font color with yellow

    Me.remain = Me.amount - Me.fpay - Me.spay - Me.tpay

    If Me.remain.Value = 0 Then
    Me.remain.ForeColor = RGB(0, 255, 255)
    Else
    If Me.remain.Value < 0 Then


    Me.remain.ForeColor = RGB(0, 2, 255)
    Else
    If Me.remain.Value > 0 Then
    Me.remain.ForeColor = RGB(0, 2, 255)
    End If
    End If
    End If

    End If

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Me.remain = Me.amount - Me.fpay - Me.spay - Me.tpay

    Should be

    Code:
    Me.Remain = Me.Amount - (Me.fpay + Me.Spay + Me.tpay)
    Then you need a select case statement

    Code:
     
    Select Case Me.Remain
      Case < 0
      Case = 0
      Case > 0 
    End Select
    David

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Changing font color based on criteria
    By Pattie Weaver in forum Reports
    Replies: 5
    Last Post: 11-02-2010, 03:38 PM
  2. Color change in form filed
    By miziri in forum Programming
    Replies: 3
    Last Post: 08-15-2009, 04:53 PM
  3. Color/font change in subform
    By AndyKim in forum Forms
    Replies: 9
    Last Post: 06-24-2009, 04:34 PM
  4. Replies: 1
    Last Post: 03-29-2009, 08:27 AM
  5. change cell color
    By bishop743 in forum Programming
    Replies: 0
    Last Post: 02-01-2009, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums