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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can backround colors alternate? 2

Status
Not open for further replies.

sorensok

Programmer
Oct 29, 2002
36
US
On my report, I was wondering if there is a way to alternate the backround colors of the detail lines. (Say one gray and the next white). If there is a simple way, I am not aware of it.

Thank you in advance,

Kyle
 
The $(*#@!&$)/color] Search LESS acillity of the site:LKJDHF:JHFDLK:JHFD thing is still / Again NON responsive. I have posted a soloution to this several times using a simple XOR of the backcolor. Again / still non-responsive search claims to be "Advanced". Mostly, it appears to be "Advancing" my frustration. MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
I'm sorry michael, but I don't quite understand your post. I looked for a solution earlier, and I found something which changes the Conditional Formating by adding this code: =MOD(ROW()-Rw,N*2)+1<=N (changing the Rw and the N's), but I could not get it to work. If you have posted something about this, could you include the string, or repost it.

Thank you,

Kyle

&quot;We believe that Mr. Burns still has that trillion dollar bill in his house, but all we've ascertained from satellite surveillance is that it's not on the roof.&quot;
 
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    'Michael Red.   2/13/2002.      To 'Toggle the backolor, which
    'Provides alternate line shading
    Const XorToggle = 4144959

    Me.Detail.BackColor = Me.Detail.BackColor Xor XorToggle

End Sub
 MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Try this in your On Detail event procedure:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Const vbLightGrey = 14540253

If Me.CurrentRecord Mod 2 = 0 Then

Me.Section(acDetail).BackColor = vbLightGrey

Else

Me.Section(acDetail).BackColor = vbWhite

End If

End Sub

Linda Adams
Linda Adams/Emory Hackman Official Web site Official web site for actor David Hedison:
 
Garridon,

I have noticed that you have posted the 'Logic' code for this a couple of times after I have posted the 'Math' code soloution, can you explain why you think the logic approach is 'better'?

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top