By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Change color of text box when printing report

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
Nov 12 '05 #2

P: n/a
Thanx this must do perfect...!!

Ps. the check box is also on the report.

Greetings,
Paul
<fr***@example.invalid> schreef in bericht
news:14********************************@4ax.com...
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 textboxon 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 havetried 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.

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.