Change Text Color When Printing (Based On A Value In Another Field) (2 Viewers)

lhooker

Registered User.
Local time
Today, 00:55
Joined
Dec 30, 2005
Messages
399
Is it possible to change the text color (when printing) based on the value of another field ? I want to check if a checkbox is selected on a form, if so I want the entire line (print record) to print in red. It looks like "Conditional Formatting" will not do this.
 

strive4peace

AWF VIP
Local time
Yesterday, 23:55
Joined
Apr 3, 2020
Messages
1,004
conditional formatting can be defined for textboxes and comboboxes but not labels. Sometimes what I do with labels is make them textboxes to use conditional formatting. That is the way to make things DIFFERENT for each record on a form.

You can select all your controls and make one conditional formatting rule that applies to each
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:55
Joined
Oct 29, 2018
Messages
21,471
Hi. I'm not sure how you're trying to do it, but I think conditional formatting should be able to do it.
 

lhooker

Registered User.
Local time
Today, 00:55
Joined
Dec 30, 2005
Messages
399
Hi. I'm not sure how you're trying to do it, but I think conditional formatting should be able to do it.

I want the print record color to be determined by a box that is checked on a form that prints the report. I been trying, but no position results
 

lhooker

Registered User.
Local time
Today, 00:55
Joined
Dec 30, 2005
Messages
399
Hi. I'm not sure how you're trying to do it, but I think conditional formatting should be able to do it.

I want the print record color to be determined by a box that is checked on a form that prints the report. I been trying, but no position results
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:55
Joined
Oct 29, 2018
Messages
21,471
I want the print record color to be determined by a box that is checked on a form that prints the report. I been trying, but no position results
Can you show us how you tried it? If you can post a sample db, we can show you how to do it.
 

lhooker

Registered User.
Local time
Today, 00:55
Joined
Dec 30, 2005
Messages
399
conditional formatting can be defined for textboxes and comboboxes but not labels. Sometimes what I do with labels is make them textboxes to use conditional formatting. That is the way to make things DIFFERENT for each record on a form.

You can select all your controls and make one conditional formatting rule that applies to each
Can you show us how you tried it? If you can post a sample db, we can show you how to do it.

Check the checkbox for "Emergency", then have each print record with a check mark (i.e. "-1") print in red. The entire line.
 

Attachments

  • x.accdb
    2.7 MB · Views: 108

strive4peace

AWF VIP
Local time
Yesterday, 23:55
Joined
Apr 3, 2020
Messages
1,004
looking now

on the form, PD_Emergency_1 is a checkbox

However, in the table design it is a Memo field, not yes/no?

what should it be?

I see PD_Conf_1, also a checkbox on the form, is defined as Text in the table design ...
 

lhooker

Registered User.
Local time
Today, 00:55
Joined
Dec 30, 2005
Messages
399
I changed "PD_Emergency_1 " (and "PD_Conf_1") to a "Yes/No" field and retied "Conditional Formatting" and I still can't get it to work.
 

strive4peace

AWF VIP
Local time
Yesterday, 23:55
Joined
Apr 3, 2020
Messages
1,004
ok, I did the same too.

1. Go to the design view of the report and add a control for PD_Emergency_1. I made it not visible
2. Select the textbox controls and choose conditional formatting
3. make a new rule with:
Expression Is: [PD_Emergency_1] = true
4. choose Red for the text color
5. click OK

conditional formatting_design view.png



When you open the report in Print Preview or Report view, the text will be Red if the condition is true

report view.png
 

Users who are viewing this thread

Top Bottom