Listbox - Impossible Problem

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

    Listbox - Impossible Problem

    I am trying to change the colors of a value in a list box when the
    values are is based on a select query. I only want the value to
    change colors, if another value associated with in the query meets the
    proper criteria. The code that I have does not work however here is
    what i have so far.

    If Me.Station01.Co lumn(1) = "UI" Then
    Me.Station01.Co lumn(0).Value.I sVisible = False
    If Me.Station01.Co lumn(1) = "OOS" Then
    Me.Station01.Co lumn(0).Value.F oreColor = vbYellow
    If Me.Station01.Co lumn(1) = "UC" Then
    Me.Station01.Co lumn(0).Value.F oreColor = vbWhite
    If Me.Station01.Co lumn(1) = "D" Then
    Me.Station01.Co lumn(0).Value.F oreColor = vbRed
    If Me.Station01.Co lumn(1) = "E" Then Me.Station01.Co lumn(0).ForeCol or
    = vbBlue
    If Me.Station01.Co lumn(1) = "A" Then Me.Station01.Co lumn(0).ForeCol or
    = vbCyan
    If Me.Station01.Co lumn(1) = "T" Then Me.Station01.Co lumn(0).ForeCol or
    = vbMagenta
    If Me.Station01.Co lumn(1) = "TA" Then Me.Station01.Co lumn(0).ForeCol or
    = vbWhite
    If Me.Station01.Co lumn(1) = "AOR" Then
    Me.Station01.Co lumn(0).ForeCol or = vbGreen
  • Larry  Linson

    #2
    Re: Listbox - Impossible Problem

    Yes, you are correct that what you want to do is not supported by the Access
    List Box. Sorry. There are some solutions for manipulating colors in the UI
    at MVP Stephen Lebans' site, http://www.lebans.com. But, I fear that what
    you want is even beyond anything he has done.

    I suspect you may be able to simulate what you want with an ActiveX grid
    control... either one that is included with the Office Developer Edition or
    a third-party Control (but be aware that those are not, in Access,
    data-bound, so you'll need a good deal of VBA code to populate and manage
    it); or, perhaps, with some care and work, using Conditional Formatting
    statements in Access 2000 or later, in a continous forms view Form embedded
    in a Subform Control.

    The last suggestion is probably the easiest for you to test, try, and check
    out.

    Larry Linson
    Microsoft Access MVP



    "Mike" <Mike.Baltrotsk y@verizon.net> wrote in message
    news:22f7b20b.0 309231031.6ce7d d60@posting.goo gle.com...[color=blue]
    > I am trying to change the colors of a value in a list box when the
    > values are is based on a select query. I only want the value to
    > change colors, if another value associated with in the query meets the
    > proper criteria. The code that I have does not work however here is
    > what i have so far.
    >
    > If Me.Station01.Co lumn(1) = "UI" Then
    > Me.Station01.Co lumn(0).Value.I sVisible = False
    > If Me.Station01.Co lumn(1) = "OOS" Then
    > Me.Station01.Co lumn(0).Value.F oreColor = vbYellow
    > If Me.Station01.Co lumn(1) = "UC" Then
    > Me.Station01.Co lumn(0).Value.F oreColor = vbWhite
    > If Me.Station01.Co lumn(1) = "D" Then
    > Me.Station01.Co lumn(0).Value.F oreColor = vbRed
    > If Me.Station01.Co lumn(1) = "E" Then Me.Station01.Co lumn(0).ForeCol or
    > = vbBlue
    > If Me.Station01.Co lumn(1) = "A" Then Me.Station01.Co lumn(0).ForeCol or
    > = vbCyan
    > If Me.Station01.Co lumn(1) = "T" Then Me.Station01.Co lumn(0).ForeCol or
    > = vbMagenta
    > If Me.Station01.Co lumn(1) = "TA" Then Me.Station01.Co lumn(0).ForeCol or
    > = vbWhite
    > If Me.Station01.Co lumn(1) = "AOR" Then
    > Me.Station01.Co lumn(0).ForeCol or = vbGreen[/color]


    Comment

    Working...