Background Colors

G

Guest

I asked this question under forms but should have asked here. I have a
Report Linked to a table. Field sample is as follows:
Deliverable 1 = 12/15/05 d1%=100
Deliverable 2 = 1/15/06 d2%=100
Deliverable 3 = 2/15/06 d3%=80
Deliverable 4 = 3/31/06 d4%=0
I have 12 Deliverables with cooresponding %.

I would like to have a report field called "status" reflect a background
color based on the above information. I was able to do this under
conditional formating for "status" text box ex: D1%<100 and Deliverable
1<Now() then change background color to red, but was only able to place 3
conditions. In reality I have 12 possible conditions. I am assuming I need
to write some VB inorder to accomplish this but I am unsure where to write
code and what that code should look like. Previous input I received under
forms does not work on my Report.
 
M

Marshall Barton

Stu said:
I asked this question under forms but should have asked here. I have a
Report Linked to a table. Field sample is as follows:
Deliverable 1 = 12/15/05 d1%=100
Deliverable 2 = 1/15/06 d2%=100
Deliverable 3 = 2/15/06 d3%=80
Deliverable 4 = 3/31/06 d4%=0
I have 12 Deliverables with cooresponding %.

I would like to have a report field called "status" reflect a background
color based on the above information. I was able to do this under
conditional formating for "status" text box ex: D1%<100 and Deliverable
1<Now() then change background color to red, but was only able to place 3
conditions. In reality I have 12 possible conditions. I am assuming I need
to write some VB inorder to accomplish this but I am unsure where to write
code and what that code should look like.


The code would go in the Format event procedure of the
section containing the status text box. It would be along
these lines:

If Me.[D1%] < 100 And Me.[Deliverable 1] < Now Then
Me.Status.BackColor = vbRed
ElseIf <another condition> Then
Me.Status.BackColor = RGB(255,220,220) 'Pink
ElseIf . . .
. . .
End If
 

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

Top