skyline666
Programmer
Hi,
I have a command button called cmbCalculate in a form called RiskEstimate, in an Access 2003 Project. On the Click event of this button, I have some code:
totalWeighting is a variable that holds a calculated number. RatingOverall is a text box that holds the value produced by totalWeighting, and puts on the end of this value if it is a low, medium or high risk.
Depending on this value, the background colour will be a certain colour. This all works. What I need is to have the background colour appear in the text box on the Form_open event of RiskEstimate. I know I need to isolate the number out of the string that is held in RatingOverall, but don't know how. When the value is isolated, I want to be able to then use it to do this:
Many thanks in advance for your help.
Andrew
I have a command button called cmbCalculate in a form called RiskEstimate, in an Access 2003 Project. On the Click event of this button, I have some code:
Code:
If totalWeighting < 15 Then
Me.RatingOverall = totalWeighting & " - Low"
Me.RatingOverall.BackColor = vbYellow
ElseIf totalWeighting < 40 Then
Me.RatingOverall = totalWeighting & " - Medium"
Me.RatingOverall.BackColor = 33023
ElseIf totalWeighting >= 40 Then
Me.RatingOverall = totalWeighting & " - High"
Me.RatingOverall.BackColor = vbRed
End If
Depending on this value, the background colour will be a certain colour. This all works. What I need is to have the background colour appear in the text box on the Form_open event of RiskEstimate. I know I need to isolate the number out of the string that is held in RatingOverall, but don't know how. When the value is isolated, I want to be able to then use it to do this:
Code:
If isolatedValue < 15 Then
Me.RatingOverall.BackColor = vbYellow
ElseIf isolatedValue < 40 Then
Me.RatingOverall.BackColor = 33023
ElseIf isolatedValue >= 40 Then
Me.RatingOverall.BackColor = vbRed
End If
Many thanks in advance for your help.
Andrew