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

report formatting - gray every other record line 1

Status
Not open for further replies.

Wrathchild

Technical User
Aug 24, 2001
303
US
just wondering if anybody has ever used a "gray" effect for a listing of items in a report within a box and grayed every other line for easy readibility? can't imagine it being done, but maybe somebody has figured it out.

thanks!
 
Add the variable declaration for lngRowCount before your On Format event code. It should look something like this:
Code:
Option Compare Database
Option Explicit
Private lngRowCount As Long

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
lngRowCount = lngRowCount + 1
If lngRowCount / 2 = CLng(lngRowCount / 2) Then
   Me.Detail.BackColor = 13750737 ' <--- change this color
Else                              ' if you don't want gray 
   Me.Detail.BackColor = 16777215 ' white
End If
End Sub
To find the correct integer value for the color I want, I like to refer to this web site: Look under the MSAccess column for the values.

Hoc nomen meum verum non est.
 
Code:
Public Function basShadeColor(lngCurClr As Long) As Long

    'Michael Red.  2/11/2002.  To Set the backcolor with alternate dhading

    Const XorToggle = 4144959

    basShadeColor = lngCurClr Xor XorToggle

End Function

A bit (perhaps) arcane, and you (the programmer?) need to have and exercise control over the instances, and -of course it does not ACTUALLY set any thing, but does return the "opposite" of what is sent (for YOU (da programmer) to use as you se fit. Like-unt-cosmos's routine, you may (will?) want to also 'expiriment' with the value fort the toggle.





MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top