change record color on report

  • Thread starter impcmd via AccessMonster.com
  • Start date
I

impcmd via AccessMonster.com

On my detail line i have recor that are sorted by date. I would like the
records with todays date to be in read and the other records to stay black.
Is there a easy way to change the color on a few record on the report.
 
M

MGFoster

impcmd said:
On my detail line i have recor that are sorted by date. I would like the
records with todays date to be in read and the other records to stay black.
Is there a easy way to change the color on a few record on the report.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There are various ways. I prefer using a VBA routine, similar to this:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Purpose:
' Put "red bars" on the detail section when the "date_column"
' is today's date.
'

Dim lngColor As Long

If Me.date_column = Date() Then
lngColor = vbRed
Else
lngColor = vbWhite
End If

Me.Section("Detail").BackColor = lngColor

End Sub

This works best when the Detail section is only one line of data.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSMmSaIechKqOuFEgEQJh/QCcCohjDuEdfVPyee+pt54jZlpwFgcAniY8
661mN1xU0bSfugpOP7Prm3z/
=sJ/o
-----END PGP SIGNATURE-----
 
Top