Control Color on Report

  • Thread starter Thread starter DontellTrevell
  • Start date Start date
D

DontellTrevell

Please Rush Help......If I change a controls color on a form, how can I make
it show up on a report. Each record on the status report needs to have
different colors based on what was selected on the form....
 
You can use code or conditional formatting in a report to change formatting
properties of controls based on values.
Changing properties of controls on a form will generally not have any
relationship to properties of controls on a report.

Can you provide any specifics on what you have and what you want? Forms,
reports, and controls all have names and values that it might be helpful to
share with us.
 
I have a table with 20 Projects. I use a form to view each project. On the
form a comment field is updated depicting recent activity performed on each
project. Then I use a report to show the updated information. What I would
like to do is: create a project status field on the form and on the report.
Henceforth, If a projects status is "on track", i want the controls BackColor
to be vbGreen. If the project is "offtrack i want the BackColor to be vbRed..
 
It sounds like you should have a field in your table that stores project
status. You could then use conditional formatting in your report to apply
various colors to text boxes based on the value of this field.
 
HELP!!
I have a combobox on the form with an Event Procedure as follows:
Private Sub Combo478_AfterUpdate()
If Combo478 = "R" Then
Me!ProjectStatus.BackColor = vbRed
Me!Combo478.BackColor = vbRed
Else
If Combo478 = "y" Then
Me!ProjectStatus.BackColor = vbYellow
Me!Combo478.BackColor = vbYellow
Else
If Combo478 = "G" Then
Me!ProjectStatus.BackColor = vbGreen
Me!Combo478.BackColor = vbGreen
End If
End If
End If
End Sub

All the above code is working fine on the form, but can you tell me
specifically, what conditional formating code I would use on the report?

Duane said:
It sounds like you should have a field in your table that stores project
status. You could then use conditional formatting in your report to apply
various colors to text boxes based on the value of this field.
I have a table with 20 Projects. I use a form to view each project. On
the
[quoted text clipped - 23 lines]
 
First of all, you should give your controls a meaningful name if you intend
to reference them anywhere else. A name like "Combo478" doesn't provide much
self documentation.

Second, I mentioned your value should be stored in a field in your table.
You seemed to have ignored this suggestion. Is Combo478 bound to any field?

You might be able to use code like this in the On Format event of your
report section:
Select Case Me.txtYourField
Case "R"
Me!ProjectStatus.BackColor = vbRed
Me!txtYourField.BackColor = vbRed
Case "Y"
Me!ProjectStatus.BackColor = vbYellow
Me!txtYourField.BackColor = vbYellow
Case "G"
Me!ProjectStatus.BackColor = vbGreen
Me!txtYourField.BackColor = vbGreen
End Select

--
Duane Hookom
MS Access MVP

DontellTrevell via AccessMonster.com said:
HELP!!
I have a combobox on the form with an Event Procedure as follows:
Private Sub Combo478_AfterUpdate()
If Combo478 = "R" Then
Me!ProjectStatus.BackColor = vbRed
Me!Combo478.BackColor = vbRed
Else
If Combo478 = "y" Then
Me!ProjectStatus.BackColor = vbYellow
Me!Combo478.BackColor = vbYellow
Else
If Combo478 = "G" Then
Me!ProjectStatus.BackColor = vbGreen
Me!Combo478.BackColor = vbGreen
End If
End If
End If
End Sub

All the above code is working fine on the form, but can you tell me
specifically, what conditional formating code I would use on the report?

Duane said:
It sounds like you should have a field in your table that stores project
status. You could then use conditional formatting in your report to apply
various colors to text boxes based on the value of this field.
I have a table with 20 Projects. I use a form to view each project. On
the
[quoted text clipped - 23 lines]
it show up on a report. Each record on the status report needs to
have
different colors based on what was selected on the form....
 
Got It!!!!!!!!!!!! Thanks for the Jump Start................Dontell Trevell

Duane said:
First of all, you should give your controls a meaningful name if you intend
to reference them anywhere else. A name like "Combo478" doesn't provide much
self documentation.

Second, I mentioned your value should be stored in a field in your table.
You seemed to have ignored this suggestion. Is Combo478 bound to any field?

You might be able to use code like this in the On Format event of your
report section:
Select Case Me.txtYourField
Case "R"
Me!ProjectStatus.BackColor = vbRed
Me!txtYourField.BackColor = vbRed
Case "Y"
Me!ProjectStatus.BackColor = vbYellow
Me!txtYourField.BackColor = vbYellow
Case "G"
Me!ProjectStatus.BackColor = vbGreen
Me!txtYourField.BackColor = vbGreen
End Select
HELP!!
I have a combobox on the form with an Event Procedure as follows:
[quoted text clipped - 27 lines]
 

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

Back
Top