Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Today, 18:35
- Joined
- Sep 6, 2004
- Messages
- 897
Hi,
For some reason, I am calculating some %age in a text box using vba codes in form's OnLoad event.
I have number of other text boxes with similar logical code to change the colors and the code is working.
But when the calculated %age figure goes more than 100, the color effect does not take place.
But when I debug the code step-by-step using F8 function key, it provide the textbox color as per condition.
Is there a way to correct it?
For some reason, I am calculating some %age in a text box using vba codes in form's OnLoad event.
I have number of other text boxes with similar logical code to change the colors and the code is working.
But when the calculated %age figure goes more than 100, the color effect does not take place.
But when I debug the code step-by-step using F8 function key, it provide the textbox color as per condition.
Is there a way to correct it?
Code:
If TxtAdmPerc.Value < 24.15 Then
TxtAdmPerc.BackColor = RGB(255, 0, 0) ' Red
TxtAdmPerc.ForeColor = RGB(255, 255, 255) ' white
TxtAdmPerc.FontBold = 12
ElseIf TxtAdmPerc.Value >= 24.15 And TxtAdmPerc.Value < 40.15 Then
TxtAdmPerc.BackColor = RGB(52, 79, 33) ' Light Green
TxtAdmPerc.ForeColor = RGB(255, 255, 255) ' white
ElseIf TxtAdmPerc.Value >= 40.15 And TxtAdmPerc.Value < 75.15 Then
TxtAdmPerc.BackColor = RGB(255, 194, 14) ' Yellow
TxtAdmPerc.ForeColor = RGB(255, 255, 255) ' white
ElseIf TxtAdmPerc.Value >= 75.15 Then
TxtAdmPerc.BackColor = RGB(84, 130, 53) ' Green
TxtAdmPerc.ForeColor = RGB(255, 255, 255) ' white
End If