Share via

Conditional Format a combo-box dropdown list

Anonymous
2014-07-11T16:42:17+00:00

if the fields displayed in a combo box include one that is a yes/no type. Is is possible to show the rows that have a yes in that field a forecolor red all others are black. (or any color formatting technique)

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

ScottGem 68,830 Reputation points Volunteer Moderator
2014-07-11T17:03:43+00:00

No, the Combolist doesn't have any such formatting capability.

You might be able to simulate it with a subform.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-07-11T19:34:38+00:00

    Very interesting Karl, I did not know that. 

    The Format property only allows for one or more characters of text and ZLS/Null conditions without regard for different text values, so there are only two possible colors.  I used A2013 and set the combo/list box's RowSource to a query like:

       SELECT flda, fldb, ColorYesNo: IIf(yesnofield, "Yes", Null) FROM tbl

    and set the Format property of the calculated query field to:

       @[Red]:"No"[Black]

    to achieve the requested result.  Seems to me that's certainly devious and more than a little convoluted, but it did work!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-07-11T17:54:21+00:00

    Hi,

    there is a way to conditionally color the text in the columns/lists of combo and list boxes using the format property of the underlying field. However it doesn't work in all Access versions. Description and samples: https://sites.google.com/site/msaccesscode/controls-2/rainbowlistboxhowtosetdifferentcolorsforcolumnsofalistboxandacomboboxcontrols

    Was this answer helpful?

    0 comments No comments