Varying the background colour of a report control

wiggychoo

New member
Local time
Today, 23:21
Joined
Jul 29, 2009
Messages
8
Hello

I am working on a report which displays price information for each record in a table. I want to be able to vary the background colour of the report control displaying the price information depending on True/False values in a number of tick box fields in the underlying table.

There are three of these tick box fields. If [Tickbox01] is checked on a given record I want the price control on the report to display Red, if [Tickbox02] is checked I want it to display Green, and so on.

Can anyone help me to do this please?

Many thanks
 
use on format event of section in which that control is placed

code would be some thing like this

if me.check1=true then
me.control.backcolor=vbred
elseif me.check2=true then
me.control.backcolor=vbgreen
endif
 
Thanks for replying

When I try this I get the compile error "Method or data member not found" - any ideas?

Code I've used is:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.FUNDING_RED = True Then Me.txtFunding.BackColor = vbRed

End If

End Sub

Appreciate your help!
 
Hi,

Have you tried the Conditional Formatting facility within the report itself. No code writing needed. You can find it under Format\ConditionalFormatting. I think if you use this option you will save yourself sometime.

FAB

John
 

Users who are viewing this thread

Back
Top Bottom