skyline666
Programmer
Hi,
I have a subform in a form, in Access 2003. The subform is in datasheet view. I have multiple fields, but only 5 are relevant to this, these are Probability, Consequence, RiskRating, Manageability and Criticality. RiskRating is equal to Probability mulitplied by Consequence, and Criticality is equal to RiskRating multiplied by Manageability. What I would like is for the cell in RiskRating/Criticality to go a certain colour for a certain value. I have tried something already but it hasn't worked, can you actually change the colour of the cell (and also still see the data in the cell) in datasheet view? My code I have is as follows (putting just RiskRating in as Criticality is and will be the same apart from the field names):
So if RiskRating is below 3, I want the cell to go light yellow.
Many thanks for your help,
Andrew
I have a subform in a form, in Access 2003. The subform is in datasheet view. I have multiple fields, but only 5 are relevant to this, these are Probability, Consequence, RiskRating, Manageability and Criticality. RiskRating is equal to Probability mulitplied by Consequence, and Criticality is equal to RiskRating multiplied by Manageability. What I would like is for the cell in RiskRating/Criticality to go a certain colour for a certain value. I have tried something already but it hasn't worked, can you actually change the colour of the cell (and also still see the data in the cell) in datasheet view? My code I have is as follows (putting just RiskRating in as Criticality is and will be the same apart from the field names):
Code:
Private Sub Consequence_AfterUpdate()
Me.RiskRating = Me.Probability * Me.Consequence
If Me.RiskRating < 3 Then
Me.RiskRating.BackColor = 8454143
ElseIf Me.RiskRating >= 3 Or Me.RiskRating < 6 Then
Me.RiskRating.BackColor = 33023
Else
Me.RiskRating.BackColor = 255
End If
End Sub
Many thanks for your help,
Andrew