Conditional Formatting a Report w/ Alternating Colors & a Can Grow field.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GregKrajacic
    New Member
    • May 2010
    • 2

    #1

    Conditional Formatting a Report w/ Alternating Colors & a Can Grow field.

    My report: Reports chronologically end-to-end milestones of my project.
    My objective: "Grey Out" from left-to-right to the last completed milestone(ie. [dtmLeaseSigned] Is Not Null.)
    My problem: I have VBA to alternate row colors (white/blue.) I also have a [memComments] field that can grow.
    My question: How do I "grey out" the Detail Section, ending at the furthest-right control that Is Not Null, considering the Detail Section grows sometimes from the [memComments] field?
    Additional Info: I have multiple fields stacked in my section (Forecast Date and Actual Date of each milestone,) so I can't simply conditionally format each control, so I'm using an unbound textbox to format conditionally. Can I create such an object on the fly? Should I set it's height to equal [memComments] height? Can I create just one control, despite that I have 8 milestones that will successively get greyed-out as their [dtmMilestoneAct ual] date gets populated? Or would I have to create 8 separate textboxes whose width's align with the edge of each milestone box? Additionally, if there are no milestones completed, how do I set the control to transparent, since a normal BackStyle would cover up the alternating blue background on some rows?

    Very much appreciated in advance!

    -Greg
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    My first point would be Why Values in Unbound Form Controls do not Persist. I think you'll find this pertinent to your considerations.

    Next, as you have already indicated clearly (oh how I wish everyone could be so specific & clear) the precise circumstances under which an item is greyed out, and the title itself indicates an awareness of Conditional Formatting, I don't see why this would not work for you. I'm pretty sure the else condition could even specify a transparent control.

    Welcome to Bytes!

    Comment

    • GregKrajacic
      New Member
      • May 2010
      • 2

      #3
      Thank you for your post, NeoPa. I fear I may be less experienced than I implied. Your link explains how unbound objects don't store any data like recordsets do.

      Should I be thinking about my post in an entirely different manner?

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Originally posted by GregKrajacic
        GregKrajacic: Should I be thinking about my post in an entirely different manner?
        If you can give an answer to the point in my second paragraph I will be in a better position to understand what you understand, and therefore be able to answer that question. At the moment I'm lacking any real information about what you may, or may not, understand.

        Comment

        • dsatino
          Contributor
          • May 2010
          • 393

          #5
          I'm a little fuzzy on what you're doing, but it sounds like it in the ball park of something I do on a couple of reports, so maybe this may help.

          Basically I use and unbound text box formatted to the color I want (gray in your case) and set it to the far left of the page aligned and sized(height) with whatever control it's going to block out. My controls are all named with a numeric value on the end in the succession that they are aligned on the page so if I have 10 controls they'd all be named ctl1...ctl10. I have a function that captures how far I'm going to gray out by returning a value between 1 and 10. For example we'll say it's 5. Then you set your Graybox.width=( ctl5.left +ctl5.width)

          hope that makes sense

          Comment

          Working...