Hello,
I have this code to enable and change the back color to white of a combo box if the value any of 3 other textboxes equals or is higher to 45. Otherwise, the combo box stays disable and gray.
The problem is that if I enter the following numbers (5, 6, 7, 8, 9), the combox box is being enabled. Any other numbers below 45, it stays disabled...
Do you have any idea why? How do I fix this?
thank you
JP
I have this code to enable and change the back color to white of a combo box if the value any of 3 other textboxes equals or is higher to 45. Otherwise, the combo box stays disable and gray.
The problem is that if I enter the following numbers (5, 6, 7, 8, 9), the combox box is being enabled. Any other numbers below 45, it stays disabled...
Do you have any idea why? How do I fix this?
VBA Code:
Private Sub Condition_1()
If Controls.Item("Reg549").Value >= "45" Or Controls.Item("Reg550").Value >= "45" Or Controls.Item("Reg551").Value >= "45" Then
Controls.Item("Reg552").Enabled = True
Controls.Item("Reg552").BackColor = "&H80000005"
Else
Controls.Item("Reg552").Enabled = False
Controls.Item("Reg552").BackColor = "&H80000004"
End If
End Sub
Private Sub Reg549_AfterUpdate()
Call Condition_1
End Sub
Private Sub Reg550_AfterUpdate()
Call Condition_1
End Sub
Private Sub Reg551_AfterUpdate()
Call Condition_1
End Sub
thank you
JP