A
a24t42
I am trying to get some color printing into a report and am having
some problems getting it set up correctly. Here is the problem -
I have 2 fields on a report -
1. An index - with numbers 0 to 4
2. Card Number
What I want to do is depending on what the index is, I want to print
the corresponding card number in a color. For example -
index 0, card number prints black
index 1, card number prints red
index 2, card number prints black
index 3, card number prints blue
index 4, card number prints green
I wrote the following code -
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [index] = "1" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 255
ElseIf [index] = "3" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 10158080
ElseIf [index] = "4" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 39680
ElseIf [index] = "2" Then
Reports!rptProduction_All!Date.FontWeight = 400
Reports!rptProduction_All!Date.ForeColor = 0
End If
End Sub
which I attached to the On Print event on the Detail report. The
printer just hangs and I get an error.
Any suggestions or help would be most appreciated. Thanks in advance.
some problems getting it set up correctly. Here is the problem -
I have 2 fields on a report -
1. An index - with numbers 0 to 4
2. Card Number
What I want to do is depending on what the index is, I want to print
the corresponding card number in a color. For example -
index 0, card number prints black
index 1, card number prints red
index 2, card number prints black
index 3, card number prints blue
index 4, card number prints green
I wrote the following code -
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [index] = "1" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 255
ElseIf [index] = "3" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 10158080
ElseIf [index] = "4" Then
Reports!rptProduction_All!Date.FontWeight = 700
Reports!rptProduction_All!Date.ForeColor = 39680
ElseIf [index] = "2" Then
Reports!rptProduction_All!Date.FontWeight = 400
Reports!rptProduction_All!Date.ForeColor = 0
End If
End Sub
which I attached to the On Print event on the Detail report. The
printer just hangs and I get an error.
Any suggestions or help would be most appreciated. Thanks in advance.