multicolor Conditional Formatting for Datasheet Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jwbird
    New Member
    • Jul 2007
    • 5

    multicolor Conditional Formatting for Datasheet Forms

    I am trying to create a form that uses multiple colors based on the status of a project(Green - engaged, Gray - complete, Red - Hold, White - not assigned...). I know that it has been done for alternate fields(gray/white) but has that been extended based on a value in the record to highlight the whole row?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    As long as your colors can be kept within 3 possibilities the way to go is to use the "Conditiona l formatting" from the Format menu, else the "grey/white" trick could be used, but is a bit cumbersome...

    Nic;o)

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      Actually you can have four colors, as long as one of the colors is the default white.

      Welcome to bytes!

      Linq ;0)>

      Comment

      • jwbird
        New Member
        • Jul 2007
        • 5

        #4
        Actually, I wasn't able to get the conditional formatting to work for the rows only the individual cell. I would like to work with 5 or 6 colors if possible.

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          Sorry, you simply can't do this with a Datasheet View form. In Conditional Formatting from the menu, you're limited to 3 formats plus the default format. In a Single View form you can do all kinds of conditional formatting using the AfterUpdate events of a control and the form's OnCurrent, but not in Datasheet or Continuous views. In the latter two views, you're limited to doing things like locking and unlocking fields in code via the OnCurrent event, but you can't change colors/fonts, etc. because the change applies to all instances of the control.

          There is no "row" object, only the controls that appear in a row. There's nothing that I've ever seen whereby you can do this kind of thing in a Datasheet form.You can, however, simulate this by doing the following:

          Set up your form in Continuous View to look like a Datasheet View form.

          In Design View, place an unbound textbox on your form.

          Make it slightly longer and slightly taller than your other textboxes.

          Move it so that it sits on top of your other textboxes, slightly to the left and right and slightly above and below the other textboxes.

          With this textbox selected , goto the Menu - Format and select Send to Back.

          Goto Formatting - Conditional Formatting

          Select Expression Is [StatusField] = "engaged"

          Select the background color as green.

          Repeat this for other values of [StatusField].

          Now the unbound textbox, which has become a "background " for your "row" will be colored according to the Conditional Formatting.

          Linq ;0)>

          Comment

          • jwbird
            New Member
            • Jul 2007
            • 5

            #6
            Thanks, I will have to try working with this as a continuous form.

            Comment

            • SanTang
              New Member
              • Apr 2008
              • 3

              #7
              You can set up conditional formatting for more than one cell in one row but it is a long and tedious job. Just do it for one cell then repeat it for all the others you need to have the same format.

              Comment

              • missinglinq
                Recognized Expert Specialist
                • Nov 2006
                • 3533

                #8
                Originally posted by SanTang
                You can set up conditional formatting for more than one cell in one row but it is a long and tedious job. Just do it for one cell then repeat it for all the others you need to have the same format.
                Actually, it's not tedious if all the cells are being formatted the same and based on the value of the same field. You simply press and hold down the <Shift> key then select each cell to be formatted, goto Format - Conditional Formatting and do your thing . All cells will be formatted in one fell swope.

                Linq ;0)>

                Comment

                Working...