On Sun, 18 Jan 2004 00:37:29 +0100, "Xiphias" <Am*******@yahoo.com>
wrote:
Hi,
Im trying to change the color of a text box on a report that im printing
from a form.
On the form I got a check box that has to tricker the color of that textbox
on the printed report.
If checked color is red else just black.
But I dont know how to do it.
I think I have to put the string in the open event of the report, but I have
tried some things, but I only get errors :)
Please help me...
Xiphias
You haven't said whether or not the Check Box on the form is part of
the recordsource of the report.
If the Check Box is included in the Report's recordsource...
To change the color of a control when certain criteria is met, code
the Format event of the section the control is in, probably in your
case, the Detail section.
If [CheckBoxName] = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If
If the Check Box is not included in the reports recordsource:
If forms!FormName!CheckBoxName = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If
The Form must be open when the report is run.
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.