Vary label BackColor and image in continuous subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuxalot
    New Member
    • Feb 2009
    • 200

    Vary label BackColor and image in continuous subform

    I have data like this:

    Code:
    MID ESColor ESLogo
    2 FFFF33 path to logo1.jpg
    2 FF0000 path to logo2.jpg
    2 00FF33 path to logo3.jpg
    Is it possible to set label backcolor and image according to row in a continuous subform?

    Thanks for looking.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32645

    #2
    No. I'm afraid it's not. See Why Values in Unbound Form Controls do not Persist.

    Comment

    • tuxalot
      New Member
      • Feb 2009
      • 200

      #3
      Thanks for the link NeoPa. I read that and conceptually I somewhat understand what you are teaching here. Now I am looking for a workaround. Would it work if the label backcolor is bound to a textbox in the row? The values in the textboxes are different in each row. Or place a series of bound labels on a form and alter their visibility and recordsource based on values in a temp table? Surely there must be a way.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32645

        #4
        Labels can never be bound as such (using the standard meaning here of containing data from the recordset - They can be associated with other controls, for instance a TextBox). The closest thing I can think of that can work in a limited way is to use Conditional Formatting. This can only effect the control that contains the data though. It is also limited to a set number of tests, and therefore possible colours.

        Originally posted by Tuxalot
        Tuxalot:
        Surely there must be a way.
        A commendable attitude normally. I see little to support that in this case though. Sorry.

        Comment

        • tuxalot
          New Member
          • Feb 2009
          • 200

          #5
          Thanks for the suggestion NeoPa. What I did was use conditional formatting on the ESColor textbox and made the Fore Color match the Back Color (rendering the font invisible). Then placed textboxes on top of the ESColor textbox with data that I want to show.

          Having a different image per row was made possible by making a bound image field. Easy - just did not know this was the way.

          Thanks all for the help!
          Last edited by tuxalot; Oct 24 '11, 08:11 PM. Reason: solved

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            If this is 2007+, you can try the on paint event of the detail section.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32645

              #7
              That's innovative thinking Tux. Good one.

              As for the images, if they are bound to the record then it may be possible, but if not, again, you're limited to what you can fashion from conditional formatting.

              Comment

              • tuxalot
                New Member
                • Feb 2009
                • 200

                #8
                Bound images worked a peach. Thanks.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32645

                  #9
                  Sounds like you're a happy camper :-)

                  Comment

                  Working...