You can do this withcodein the report's events.
1. Declare a variable in the General Declarations section of the report's
module (at the top, with the option statements.)
2. In the Print event procedure of the (Detail?) section, store the
current
record's value to the variable.
3. In the Format event procedure of the same section, compare the current
record's value to the variable, and change the ForeColor/BackColor or
whatever you want formatted.
- Show quoted text -
Sorry I wasn't able to get it working. Below is my code. Basically
it changed everything to blue, and I found out when it's run to
Sub_Detail_Format, the CurrentStyleNum is always "".
My question is, will this run Sub_Detail_Print and then
Sub_Detail_Format for each records, or it runs all the records for
Sub_Detail_Print and then run all the records for Sub_Detail_Format.
Thanks for your help,
Dim CurrentStyleNum As String
------------------------------------------
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [StyleNum] <> CurrentStyleNum Then
[StyleNum].ForeColor = vbBlue
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
CurrentStyleNum = [StyleNum]
End Sub