Text Box BackColor different for each row in continuous form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    Text Box BackColor different for each row in continuous form

    Hi Guys,

    Anyone know if this is possible?

    I have a need to display multiple colours in a subform, next to a colour reference name. My row source includes the RGB values (intColorRed, intColorBlue, intColorGreen).

    I currently have the subform set up with the colour name and an unbound text box which I can easily recolour using

    Code:
    Me.ColourPreview.BackColor = RGB( (Me.the vars above) )
    I can't figure out how to make each one adhere to its RGB settings, changing one changes them all, now matter which event I use.

    Any insights are much appreciated.
  • JustJim
    Recognized Expert Contributor
    • May 2007
    • 407

    #2
    Originally posted by GazMathias
    Hi Guys,

    Anyone know if this is possible?

    I have a need to display multiple colours in a subform, next to a colour reference name. My row source includes the RGB values (intColorRed, intColorBlue, intColorGreen).

    I currently have the subform set up with the colour name and an unbound text box which I can easily recolour using

    Code:
    Me.ColourPreview.BackColor = RGB( (Me.the vars above) )
    I can't figure out how to make each one adhere to its RGB settings, changing one changes them all, now matter which event I use.

    Any insights are much appreciated.
    Check out Stephen Lebans sample DB here which might be of help.

    Also a previous Bytes discussion here.

    Jim

    Comment

    • FishVal
      Recognized Expert Specialist
      • Jun 2007
      • 2656

      #3
      Originally posted by JustJim
      Check out Stephen Lebans sample DB here which might be of help.

      Also a previous Bytes discussion here.

      Jim
      Conditional formatting allows up to 3 different formats only.

      @Gaz
      No way with subform. Use an other control.

      P.S. I see at least three candidates to this role: MSComCtl.ListVi ew, MSComCtl.TreeVi ew, OWC11.Spreadshe et.

      Comment

      • GazMathias
        Recognized Expert New Member
        • Oct 2008
        • 228

        #4
        Originally posted by FishVal
        Conditional formatting allows up to 3 different formats only.

        @Gaz
        No way with subform. Use an other control.

        P.S. I see at least three candidates to this role: MSComCtl.ListVi ew, MSComCtl.TreeVi ew, OWC11.Spreadshe et.
        Thanks Fish' I'll check those out!

        Gaz.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32653

          #5
          That's a tough one Gaz.

          Although bound controls can display different values according to what's in the dataset record, Access only has one instance of the control itself. This means that all versions seen on the form reflect the same attributes until you change something, when all change to reflect that of course.

          Comment

          • FishVal
            Recognized Expert Specialist
            • Jun 2007
            • 2656

            #6
            Just a thought.
            If you use Access 2007, you may see what could be done using bound Image control (in a case when color list is not expected to change) or rich text control.

            Comment

            • GazMathias
              Recognized Expert New Member
              • Oct 2008
              • 228

              #7
              Thanks for your efforts guys, I have now decided to write the system as a web application. This solves the issue. I should have stated before also that the parent record to that above could have multiple instances of the colourways and I would need to draw them all!

              So much simpler to just loop the data into a table, convert the RGB values to hex and write them to a td's style.

              Gaz

              Comment

              Working...