I have a form where a user inputs a value. The conditional formatting evaluates that value and sets the back color of the text box to the corresponding color. This works ok so long as the number entered is less than 100. Once it's over 100 it seems to evaluate only the first two digits of the number.
"valkpi" is the value the user enters
"txtinvert" is a selection that the user selects when establishing the criteria to judge the number against. It reverses the upper and lower bound of the value.
"txtlow" & "txthigh" are the lower and upper bounds respectively
I just don't understand what I have to change in order to get the system to evaluate the input properly. Any help is greatly appreciated.
I've also included a few pictures to show what I mean.
"valkpi" is the value the user enters
"txtinvert" is a selection that the user selects when establishing the criteria to judge the number against. It reverses the upper and lower bound of the value.
"txtlow" & "txthigh" are the lower and upper bounds respectively
I just don't understand what I have to change in order to get the system to evaluate the input properly. Any help is greatly appreciated.
I've also included a few pictures to show what I mean.
Code:
valkpi = Me.txtResult
If Me.txtinvert = 0 Then
If valkpi < Me.txtLow Then
Me.txtResult.BackColor = vbRed
ElseIf valkpi >= Me.txtLow And valkpi < Me.txtHigh Then
Me.txtResult.BackColor = vbYellow
ElseIf valkpi >= Me.txtHigh Then
Me.txtResult.BackColor = vbGreen
End If
ElseIf Me.txtinvert = -1 Then
If valkpi > Me.txtLow Then
Me.txtResult.BackColor = vbRed
ElseIf valkpi > Me.txtLow And Me.txtResult < Me.txtHigh Then
Me.txtResult.BackColor = vbYellow
ElseIf valkpi <= Me.txtHigh Then
Me.txtResult.BackColor = vbGreen
End If
End If