Font Changing in Report

B

bdehning

If I have the following switch as part of a text box, is there any way to assign different color font for each item in "". For example Red for Waive Service Call, Green for Pending, etc.

=Switch([Waive Service Call],"Waived",[Cancel Service Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Date Written Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Report Sent]),"Completed",True,"Pending")
 
B

Brian Kastel

If it is a report, then you can use the Detail_Format event in the report's
module to change the font or color of anything you want.

If the detail section of the report contains the text box [txtStatus], then
this code should work:

Select Case [txtStatus]
Case "Waived"
txtStatus.ForeColor = vbRed
Case "Canceled"
txtStatus.ForeColor = vbBlue
Case "Pending", "Rescheduled"
txtStatus.ForeColor = vbGreen
Case Else
txtStatus.ForeColor = vbBlack
End Select


bdehning said:
If I have the following switch as part of a text box, is there any way to
assign different color font for each item in "". For example Red for Waive
Service Call, Green for Pending, etc.?
=Switch([Waive Service Call],"Waived",[Cancel Service
Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Date Written
Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Report
Sent]),"Completed",True,"Pending")
 
D

D

bdehning said:
If I have the following switch as part of a text box, is there any way to
assign different color font for each item in "". For example Red for Waive
Service Call, Green for Pending, etc.?
=Switch([Waive Service Call],"Waived",[Cancel Service
Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Date Written
Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Report
Sent]),"Completed",True,"Pending")
 
B

bdehning

Its actually in a header called "Scheduled Service Month". I have nothing in detail section.

So I am confused about [txtstatus]

I tried to add an unbound field [txtstatus] and nothing happened. How do I tie the item in the detail section to my header switch which has a name of text218

Thanks
----- Brian Kastel wrote: ----


If it is a report, then you can use the Detail_Format event in the report'
module to change the font or color of anything you want

If the detail section of the report contains the text box [txtStatus], the
this code should work

Select Case [txtStatus
Case "Waived
txtStatus.ForeColor = vbRe
Case "Canceled
txtStatus.ForeColor = vbBlu
Case "Pending", "Rescheduled
txtStatus.ForeColor = vbGree
Case Els
txtStatus.ForeColor = vbBlac
End Selec


bdehning said:
If I have the following switch as part of a text box, is there any way t
assign different color font for each item in "". For example Red for Waiv
Service Call, Green for Pending, etc.
=Switch([Waive Service Call],"Waived",[Cancel Servic
Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Date Writte
Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Repor
Sent]),"Completed",True,"Pending"
 
B

Brian Kastel

I simply used [txtStatus] as an assumed name for the control displaying the
result of the Switch since you didn't provide that. All you have to do is
replace the name, there. Put the code into the PageHeaderSection_Format
event, then, instead of Detail_Format.

But I'm perhaps confused, now. If, as you say, you have nothing in the
detail section, then what is the item in the detail section you want to
"tie" to?


bdehning said:
Its actually in a header called "Scheduled Service Month". I have nothing in detail section.

So I am confused about [txtstatus] .

I tried to add an unbound field [txtstatus] and nothing happened. How do
I tie the item in the detail section to my header switch which has a name of
text218.
Thanks.
----- Brian Kastel wrote: -----


If it is a report, then you can use the Detail_Format event in the report's
module to change the font or color of anything you want.

If the detail section of the report contains the text box [txtStatus], then
this code should work:

Select Case [txtStatus]
Case "Waived"
txtStatus.ForeColor = vbRed
Case "Canceled"
txtStatus.ForeColor = vbBlue
Case "Pending", "Rescheduled"
txtStatus.ForeColor = vbGreen
Case Else
txtStatus.ForeColor = vbBlack
End Select


bdehning said:
If I have the following switch as part of a text box, is there any
way to
assign different color font for each item in "". For example Red for Waive
Service Call, Green for Pending, etc.?
=Switch([Waive Service Call],"Waived",[Cancel Service
Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Date Written
Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Report
Sent]),"Completed",True,"Pending")
 
B

bdehning

Thanks for the help

I put your code in my in the header on Format and it works great

I learn something everyday on this site!!

How many color choices are there

----- Brian Kastel wrote: ----


I simply used [txtStatus] as an assumed name for the control displaying th
result of the Switch since you didn't provide that. All you have to do i
replace the name, there. Put the code into the PageHeaderSection_Forma
event, then, instead of Detail_Format

But I'm perhaps confused, now. If, as you say, you have nothing in th
detail section, then what is the item in the detail section you want t
"tie" to


bdehning said:
Its actually in a header called "Scheduled Service Month". I have nothin in detail section
So I am confused about [txtstatus]
I tried to add an unbound field [txtstatus] and nothing happened. How d
I tie the item in the detail section to my header switch which has a name o
text218
Thanks ----- Brian Kastel wrote: ----
report'
module to change the font or color of anything you want
If the detail section of the report contains the text bo
[txtStatus], the
this code should work
Select Case [txtStatus
Case "Waived
txtStatus.ForeColor = vbRe
Case "Canceled
txtStatus.ForeColor = vbBlu
Case "Pending", "Rescheduled
txtStatus.ForeColor = vbGree
Case Els
txtStatus.ForeColor = vbBlac
End Selec
If I have the following switch as part of a text box, is there an
way t
assign different color font for each item in "". For example Red fo Waiv
Service Call, Green for Pending, etc.
=Switch([Waive Service Call],"Waived",[Cancel Servic
Call],"Canceled",[Rescheduled Service Month],"Rescheduled",[Dat Writte
Report Sent] Is Not Null,"Completed",Not IsNull([Date Written Repor
Sent]),"Completed",True,"Pending"
 
B

Brian Kastel

How many color choices are there?

8, using the standard color constants (use the Object Browser to find
ColorConstants).

29, using the system color constants (use the Object Browser to find
SystemColorConstants).

16 million, using the RGB() function (use Help for details).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top