Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternate Grey But With 2 Groups

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I am using Crystal 9.0 accessing an MS Access 2002 database.

I have 2 groups Group A is HCN and Group B is AdmitDate. I had to add AdmitDate so I could create a "maximum" diagnosis in Group B to reference in a formula for Group A.

Anyway, if I only had one group I would use the code of:

if groupnumber mod 2 = 0 then crNoColor else Color (201,201,201)

to get alternating grey lines but it doesn't work when there is an additional Group. Is there any way around this?

Thanks.
 
Hi

I found the answer and it was posted by Rosemary Lieberman
who indicated she teaches this to her classes:

Create a running total (Insert Field Object/Running Total) and choose the Group or Detail field as the case may be. Select Count, Evaluate on Change of Record, Reset Never.

Now you have a counter field that counts the "visible" records and you would use that in the formula.

So what I did was create the formula as above and in the colour section used the formula:
if {#RTotals} mod 2 = 0 then crNoColor else Color (201,201,201)

Now it alternates colour - how cool!! Thanks Rosemary wherever you are!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top