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!

Add "Green Bar" effect to your reports 3

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
This will give a green bar effect on a report. Every other line green. You may want to play around with the numeric color expressions if you don't like the loud green you get from vbGreen. Just a tip...


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

If Me.Detail.BackColor = vbWhite Then
Me.Detail.BackColor = vbGreen
Else
Me.Detail.BackColor = vbWhite
End If

End Sub
[/blue]





ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Nice one! Enjoy the star!

Jim DeGeorge [wavey]
 
Somewhat easier:

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

Of course, the const used in this provides a light grey, but you can use a different constanta and get any color desired.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Michael

Where is "Xor" as in "Me.Detail.BackColor Xor XorToggle" defined?

Jim DeGeorge [wavey]
 
Jim,

XOR = eXclusive OR:

False XOR False = False
True XOR False = True
False XOR True = True
True XOR True = False (as opposed to 1 OR 1 = True)

And indeed Michael's solution (that I saw posted several times over these forums) works just fine with just 2 lines of code, including variable declaration. I believe I have already starred this formula before, so I won't do it again, but it really deserves more than one star.

Dan


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top