Conditional Format Based on a Different Cell

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carolyn

    #1

    Conditional Format Based on a Different Cell

    I am trying to conditionally format an unbound field in an access form
    based on the value in another access field. The unbound field is
    actually the background to the form. I want users to be aware of the
    status of the case that they are working on. For example, if the
    status field is "Closed", I want the unbound field (background of
    detail section) to be red. If it is "Inactive", I want the unbound
    field to be yellow. If it is anything else, I want it white. I have
    tried this numerous ways and have searched through postings. I hope
    someone can help.

    Thanks,
    Carolyn
  • fredg

    #2
    Re: Conditional Format Based on a Different Cell

    On 23 Jun 2004 12:59:57 -0700, Carolyn wrote:
    [color=blue]
    > I am trying to conditionally format an unbound field in an access form
    > based on the value in another access field. The unbound field is
    > actually the background to the form. I want users to be aware of the
    > status of the case that they are working on. For example, if the
    > status field is "Closed", I want the unbound field (background of
    > detail section) to be red. If it is "Inactive", I want the unbound
    > field to be yellow. If it is anything else, I want it white. I have
    > tried this numerous ways and have searched through postings. I hope
    > someone can help.
    >
    > Thanks,
    > Carolyn[/color]

    This will be on Single Form view only.

    You do not need an unbound form for this.
    You can change the detail back color directly.

    Place the following code in both the form's Current event, and in the
    [Status] AfterUpdate event:

    If [Status] = "Closed" Then
    Me.Section(0).B ackColor = vbRed
    ElseIf [Status] = "Inactive" Then
    Me.Section(0).B ackColor = vbYellow
    Else
    Me.Section(0).B ackColor = vbWhite
    End If

    --
    Fred
    Please only reply to this newsgroup.
    I do not reply to personal email.

    Comment

    Working...