Alternating color based on a group in 2007

I have a report that I woul like to alternate the color for each group in 
2007 I thougth I knew how to do this but it is not working for me at all.
Any suggestions
2/29/2008 6:58:48 PM
access.reports 4434 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 54

Are you trying to alternate the color for each record?

If so, open the report in design view, select the Detail section, and set 
the Alternate Back Color property.

If you want to alternate the color for entire groups (not for each record), 
you could do that with a combination of Running Sum and either Conditional 
Formatting or Format event:

1. Place a text box in your Group Header, and give it these properties:
    Control Source    =1
    Running Sum      Over All
    Format               General Number
    Visible                No
    Name                 txtGroupCount

2. Set the On Format event of the Detail section to:
    [Event Procedure]
Click the Build button (...) beside this.
Access opens the code window.
Set up the routine like this, replacing the vbBlue and vbRed with the RGB 
colors you want:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim lngColor As Long

    If FormatCount = 1 Then
        lngColor = IIf(Me.txtGroupCount Mod 2 = 0, vbBlue, vbRed)
        If Me.Section(acDetail).BackColor <> lngColor Then
            Me.Section(acDetail).BackColor = lngColor
        End If
    End If
End Sub

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -
Reply to group, rather than allenbrowne at mvps dot org.

"Michelle" <> wrote in message
>I have a report that I woul like to alternate the color for each group in
> 2007 I thougth I knew how to do this but it is not working for me at all.
> Any suggestions 

3/1/2008 8:19:48 AM

Similar Artilces:

how do i print in color instead of grayscale
I am trying to get my pub file that prints in grayscale to print in color Help! Is it actually printing in grayscale or are you using Pub 2007 w/ an HP printer and looking at Print Preview? -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question "Anthony Hodge" <Anthony> wrote in message >I am trying to get my pub file that prints in grayscale to print in color > > Help! > JoAnn, My color HP shows color in ...

Office 97 on Windows 98 compatability with Office 2007 on Windows
Could anyone advise is it possible to transfer the following Office 97 docs on an old computer running Win 98 to a new computer with Office 2007 running on Windows 7 - 1. Word 97, Excel 97 & Powerpoint 97 2. Outlook Express (v.6) e-mails & e-mail addresses Any advice appreciated ( by a dinosaur) Word 2007, Excel 2007 and PowerPoint 97 all have an option to save files in 97-2003 format, so it would be a pretty good guess that they can read files in that form. That it is running on Windows 7 should not make a difference. For OE you should ask in an OE newsgroup, as...

Pivot Table selection that will allow Grouped fields to show up in each cell
Hello - Is there a Pivot Table selection that will allow Grouped fields to show up in each cell? The standard view generates a blank in each new row...but I need to be able to display the grouped data in each cell, rather than a blank if possible. For example: Month State Amount Jan TN 500 Blank KY 300 Blank GA 25 Feb TN 35 Blank KY 28 I am hoping there is a pivot table option that will allow me to display "Jan" instead of blanks in the above example Not through xl2007. I don't know about xl201...

Excel 2007 opening a document as garbage that was created in Excel 2002.
I'm using a Excel 2002 and we have a customer using Excel 2007. The customer have attempted to use both version, one with VBA code in it and one without VBA code in it I'm using Excel 2002 and we have a customer using Excel 2007. The customer has attempted to open both versions of the file that I created using Excel 2002 and the customer get garbage stuff showing within Excel 2007. Is there a tool I can use to attempt to determine what is causing the issue? Apparently, it's not the VBA code as I removed all VBA code in the revised version thinking it may have had somethin...

MSCommCtrl alternative??
I would like to use the com port to communicate with an external device. MSComm32, an ActiveX control, fits the bill fine for this if you happen to have a dialog open that can parent the control. That way, you can create a control variable of the Comm32 class and have access to all its glory. In my application, I have no dialog that hosts the control. I realize this exposes my ignorance of ActiveX and COM but is there a reasonably simple way to get access to an ActiveX control's functionality without having it reside in a dialog? Thanks in advance, Bob Bob Curry wrote: > I would ...

Excel 2007 Font color issue
Excel 2007 in Vista Ultimate SP1 If I open Excel, open a spreadsheet, highlight several cells to change the font color - Excel stops working. This happens if I use the drop down menu (triangle on right of button) of the "font color button" in the ribbon or on the Quick Access toolbar. If I change the font in a cell using either color button, not the drop down menu, all is well. I had this issue when I first installed Office 2007 Pro, then it went away, now it is back. I have no idea what transpired over time to end/start the situation. This is the message data I get, I have...

background-foreground color
HOw can I change the background and foreground color of an excel graph? I tried : ------------------------------------ With myChart.ChartArea.Fill .Visible = True .ForeColor.SchemeColor = 15 .BackColor.SchemeColor = 17 End With ------------------------------------ the background color changes but the foreground does not change...Does foreground here mean the grey area because thats the color I want to change. Thanks -- Message posted via If you are working with an embedded chart, select the outside of the chart and run this macro: Sub ChangeColors1() ...

What is the best way to change the Base Currency....
One of my clients wants to change the base currency from USD to AUD due to change in their Business structure. One way to do this is to create a New Organisation through Deployment Manager but in that case, I need to import all the customisations (customisations are quite complex in this scenario) and then migrate data from old organisation in to the new database or organisation. This is as good as almost implementing the whole system again. Is their any other way we can change the Base Currency? I would appreciate help from someone who has already gone through this excercise. Best regards, ...

My screen colors are inverted
I have a HP mini 110. Don't know how it happened, but about three days ago my screen started to display inverted colors. It's pretty odd, I dont like it at all. I was wondering if anybody knows how to reverse this? I want my colors to show normally, not inverted. Anybody know how to fix this? -- NeedHelpLikeAsap ------------------------------------------------------------------------ NeedHelpLikeAsap's Profile: View this thread:

Money Home & Business 2007 to Money 2008 Plus?
Can I 'upgrade' from Money Home & Business 2007 to Money 2008 Plus/premium? I.E. can I drop the business parts without a problem? Thanks! John Yes, you will get some nags about "lost functionality" but you can ignore those. -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see;EN-GB;mny. I do not respond to any emails that I have not specifically asked for. "John" <> wrote in message > Can I 'upgrad...

move sent items to alternate folder dependant on sender email addr
Hi I have an issue, caused by having multiple mailboxes open in outlook, this is a business requirement with different email addresses (and domain names) for different business areas. (eg and I am using outlook2003, backed by exchange 2003. I want to automatically place sent items in the correct sent items folder depending upon what email address (account) was used to send out an email. Whichever is the primary email account currently has all sent items in it. (eg sent from and Although it is possible to manually just cop...

Venn Diagram
Is there a way to fill the overlapping colors? We don't want the blended colors between the three circles? If not, is there a way to do this by just drawing 3 circles and filling in the overlapping colors? Thanks! Overlap the three circles and use the Fragment command. This will create seven shapes (A,B,C,AB,AC,BC,ABC) that you can fill with more appropriate colours. John... Visio MVP Need stencils or ideas? Need VBA examples? Visio Wishlist "kvc" <kvc123...

Converting graphics to vector-based
Is there any way to take an excel-produced chart (with 2000 plot points) and export or convert it into a vector- based graphic, such as Illustrator? Or, at least into a graphics package that can be visually enhanced? All we can do is a screen-capture (quality not acceptable). Thanks for your help. ...

Application-defined or Object-defined-error when changing color in
I have tried the following different approaches to chaning the background color of a cell in an Excell 2007 VBA module and have gotten Application-defined or Object-defined-error each time. I can display the color value I just can't seem to be able to change it. Sheet1.Cells(1, 2).Interior.Color = RGB(126, 255, 126) Worksheets("sheet1").Cells("A1").Interior.ColorIndex = 3 ActiveSheet.Cells(Cell).Interior.ColorIndex = 255 Range("A1").Cells.Interior.ColorIndex = 1 Any help is welcomed. Thank you in advance for your help. hi t...

sending from contact group
"Send E-Mail" is not displayed when inserting an address from my contact group. It is ok when an address is set in directly. Can anyone advise please? Jack Where exactly are you inserting that email address? Gary VanderMolen, Microsoft MVP (Mail) "jack861070 - BT Total Broadband email account" wrote in message news:urijP3XFLHA.5736@TK2MSFTNGP02.phx.gbl... "Send E-Mail" is not displayed when inserting an address from my contact group. It is ok when an address is set in directly. Can anyone advise please? Jack ...

Data validation based on another cell
Im not quite sure what to put in the title, but heres my problem: I want prevent people from inputing into a cell if other cells have been filled in. A1 has no value B1 has no value C1 has X D1 then cannot have a value because A1:C1 has an X in one of the other three cells :: but if you make C1 have no value then D1 would be able to input an X into that cell, however then the other cells you would not be able to. Im assuming you would use data validation, things ive tried is custom data validation with formulas such as COUNTA(A1:C1)>2, also tried IFTEXT(A1... i tried a few forumlas which...

Outlook 2007 + Connector
Hi there, I have Outlook 2007 installed with Connector as well. They both are working beautifully well. Outlook has synch all my folders with messages and so on. However, my question is, how do I download at once all the emails and folders I have from Hotmail server into my local PC machine, so I could read all my emails without being connected to the internet. Thank you and much appreciated your help. Ctrl+Alt+S - choose the send/receive group and click Edit. Set the connector account to download full messages. Once down, you can read messages when offline. -- Diane Poremsky [MV...

Alternative to
Hi all, Thanks for your help in advance. Well I am at nadir in terms of knowledge of MFC and any other GUI development thing, But I have to solve a Bug which is like that in a Window, a menu which appears on double right click should come up instead in single right click. It is using currently the following things to do the same ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick) void CTreeInfoWnd::OnRclick(NMHDR* pNMHDR, LRESULT* pResult) Earier I thought I should use the following ON_WM_RBUTTONDOWN() void CTreeInfoWnd::OnRButtonDown(UINT nFlags, CPoint point){ but here the problem is I need NM_LI...

=IF(Color=green) ?
How can i decide if a cell has a background color green, do something... like =if(G6:Color=Green;"something";"other") And, In the same idea, if i have a column with date... I want that the date is checked in the second sheet and if is between 2 dates mentionned in the second page, i want to put a the color that the cell of the second page has. omg, tough no ? :P :confused: Thanks for helping me ! ------------------------------------------------ ~~ Message posted from ~~ View and post usenet messages directly from ...

Displaying a Bitmap in a Dialog-Based Application
Hi: I have a vc++ .NET dialog-based application that I'm trying to display a bitmap on. In reading earlier postings it looks like I should use a picture control and insert my bitmap into it. I've been trying to do that, but I'm not having much luck. I can insert a bitmap into my project (IDB_BITMAP1). I also have a picture control on my dialog box (IDC_STATIC_PICTURE) to which I've assigned the CStatic variable m_pict. One earlier posting said I should assign the Bitmap property to my bitmap file, but I bring up the properties for my picture control and there is no Bitma...

Uniqueness based on Attribute-value
Hi, Is it possible in Xml to enfore the uniqueness of an element based on his attribute value. Say I have this schema : <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="" xmlns:xs="" xmlns="" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="StrResources" type="StrResourcesType"/> <xs:attribute name="Language...

Change background color in a cell.
Hi, I wish to test a value in a cell and change the background color is a range of values is present. More exactly: IF x <= 30 then read color IF x > 30 & x < 60 then yellow IF x >= 60 then dark Is it possible? Many thanks in advance for your kind cooperation. Regards, gio123bg --- Message posted from Hi try 'Format - Conditional format' Frank > Hi, > I wish to test a value in a cell and change the background color is a > range of values is present. > More exactly: > > IF x <= 30 then read color > IF x > 30 ...

No Calendar in public Folder In Exchage 2007
We have a department that wants to share a calndar for vacation time. We use to do this as a calendar in a public folder. SInce we do not have Sharepoint I guess the best approach is to create a user and share his calander so that everyone in that department can access it and add their time in. Is it better to set this up as a user or as Resource or Eqipment? Thanks! You can still use Public Folders for Calendar items. -- Bharat Suneja MVP - Exchange NEW blog location: ---------------------------------------------- "D303M" <D303M@...

Colors of columns after sorting data in the supporting table
When creating a chart off of a table, the colors of each column appear to be in the order of their display in the chart. For example, let's say I have January data as red, February data as white and March data as blue. Then I sort the table in the Excel sheet by value. Now the labels are ordered February, March, January. Well, now the first column (February) is red, the second (March) white and the third (January)blue. Is there a method to hard-code the column color to the data label in the charts rather than simply the order that the data appears? I'm about to do this on a pro...

Print Preview colors
Hello, My app is using the standard Doc/View Print Preview function. The preview works fine but only the images are drawn not correct. I guess this has to do with the fact that the preview function is drawing them with 256 colours. Does anyone know if I'm correct and how to change this so that the images are drawn with more colours? Thanks in advance, Arno After further testing it appears that the problem isn't caused by the amount of colours but has something to the scale of the image. (CDC::StretchBlt function ?) When I draw an image at 100% the colour is good. What adjustmen...