Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2010
    Posts
    9

    Unanswered: Conditional Formatting for List Box

    Hello,

    I have a large list box with multiple columns and rowsources (all pulled from 1 table), I was wondering if it was possible to conditionally format values in this list. I know you are able to do it for text-boxes, but I need to conditionally format specific columns.

    For example a list would be like this. 4 columns

    Name Yes No Yes
    Name2 No No Yes

    I want to conditionally format columns 2-4 where value="Yes" is highlighted green, and "No" is highlighted red.

    As of now I have not seen any lists that have been conditionally formatted by column value

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    am not sure that conditional formatting of the background of a listbox is even possible at all. definitely isn't an embedded feature.

    you could consider a subform
    www CahabaData com

  3. #3
    Join Date
    Nov 2010
    Posts
    9

    randaro Sin

    I don't have much experience with subforms, but i built queries that depend on the selected rowsource (user clicks list selction, then command button that opens a new form and displays something specific about selection)

    Is that still possible with a subform?

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by BennyC View Post
    ...I have not seen any lists that have been conditionally formatted by column value
    That's because it can't be done! I'm afraid NTC's suggestion of using a Subform and Conditional Formatting is about as close as you can come.

    With the Subform set to display in Datasheet View, which can be formatted to resemble a Listbox, you could use the Double-Click event of one or more Textboxes and open your second Form.

    With the Subform set to display in Continuous View, which can, with a little more effort, also be formatted to resemble a Listbox, you could actually have a Command Button on each record and open your second Form with it.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    short of writing your own control I don't think its possible
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Nov 2010
    Posts
    9
    How do you write your own control? Is this done in VBA/MySequel?

    Can Access read custom controls? Any help with this would be great.

    And thanks all for the advise with subforms etc.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I get confused switching between VB, VBA & VB.NET
    It a while since I dabbled in the dark arts of creating controls, but I've a suspicion that the last time I tried was in VB & VB.NET
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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