Update a field color based on field contents

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

    Update a field color based on field contents

    Hi guys,

    I'm using a subform to display a list of values from a single table.
    The form is showing the values in "continuous forms" view and there
    will only ever be two different values for the form. The form show 2
    fields, 1 is a number and the second is a calculated field that says
    either "Valid" or "Invalid" based on the first fields contents. What
    I need to do is if the value is Invalid then I'd either like the text
    or the actual field to be red so it stands out from the other fields
    but if the value is Valid then I want the field to be standard (i.e.
    white background, black text.).

    Could anyone help me to work this out as it's probably very simple but
    I've been pulling my hair out this morning (and there isn't very much
    to begin with.).

    Many thanks, Dean...
  • fredg

    #2
    Re: Update a field color based on field contents

    On Mon, 16 Jun 2008 12:26:12 -0700 (PDT), DeanL wrote:
    Hi guys,
    >
    I'm using a subform to display a list of values from a single table.
    The form is showing the values in "continuous forms" view and there
    will only ever be two different values for the form. The form show 2
    fields, 1 is a number and the second is a calculated field that says
    either "Valid" or "Invalid" based on the first fields contents. What
    I need to do is if the value is Invalid then I'd either like the text
    or the actual field to be red so it stands out from the other fields
    but if the value is Valid then I want the field to be standard (i.e.
    white background, black text.).
    >
    Could anyone help me to work this out as it's probably very simple but
    I've been pulling my hair out this morning (and there isn't very much
    to begin with.).
    >
    Many thanks, Dean...
    Access 2000 or newer?
    You can use the control's Conditional Formatting.

    In Form Design View, select the calculated control.
    Click on Format + Conditional Formatting.
    Set Condition1 to
    Field Value Is equal to
    write
    "Invalid"
    in the next box.
    Select the appropriate backcolor/forecolor color you wish.
    Save the change.

    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail

    Comment

    • DeanL

      #3
      Re: Update a field color based on field contents

      Thanks Fred,

      That worked like a charm and does exactly what I need it to.

      Much appreciated.

      Dean...

      Comment

      Working...