Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    18

    Unanswered: Reports: change bg color on group change

    Hi all

    Looking up the forums, I haven't found any tip that can help me.

    In a report, I simply need to change background color of the details when the main group changes..

    Can You help me?

    Thank You

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    "change background color of the details when the main group changes"
    what did you mean?
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Sep 2003
    Posts
    18
    Originally posted by Kakha
    "change background color of the details when the main group changes"
    what did you mean?

    Sorry. I haven't explained well my needs.

    I make an example, suppose we have the following report about the organization of a Company:

    Group 1: Department, without Header/Footer, ascending
    Group 2: Age, without Header/Footer, descending
    Detail: Department, age, employee_name..

    The output I need is the following (the last field is the color needed):

    (DEPT, AGE, NAME) --> COLOR
    HR, 29, Rush --> WHITE
    R&D, 35, Moore --> RED
    R&D, 24, Robson --> RED
    R&D, 21, Cole --> --> RED
    Sales, 46, Best --> WHITE
    Sales, 35, Smith --> WHITE

    Hope it's understandable..

    Thx

  4. #4
    Join Date
    Sep 2003
    Posts
    18
    Really no-one can help?

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    so you want alternating red and white in your detail section?

    You could change the color by adding code to the footer section of the department group.

    Something like:
    Code:
    If me.detail.BackColor = RGB(255,0,0) Then
       me.detail.BackColor = RGB(255,255,255)
    Else
       me.detail.BackColor = RGB(255,0,0)
    End If
    Also, this code will be effective in either the OnPrint, or OnFormat events of the group footer, in case you were wondering.

    Last edited by Teddy; 04-02-04 at 11:43.

  6. #6
    Join Date
    Sep 2003
    Posts
    18
    GREAT!
    The solution you suggests is exacly what I expected!

    First detail: you have to set the fields' background transparent.
    Second detail: you must HAVE a footer section.. in my case it has length zero.

    Great thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •