Hi
I have a really simple piece of code that enables or disables 3 controls depending on the state of a checkbox. This was working fine until I applied conditional formatting to these controls. Could it be that the conditional formatting could be re-enabling the controls even when the code above is clearly running (I see it stepping through) and is doing what it should.
As soon as the code is done - the controls get re-enabled. Any ideas why and is it likely to be the conditional formatting that is re-enabling the controls ?
I have a really simple piece of code that enables or disables 3 controls depending on the state of a checkbox. This was working fine until I applied conditional formatting to these controls. Could it be that the conditional formatting could be re-enabling the controls even when the code above is clearly running (I see it stepping through) and is doing what it should.
As soon as the code is done - the controls get re-enabled. Any ideas why and is it likely to be the conditional formatting that is re-enabling the controls ?
Code:
Sub Check_ASL_State()
If Me.chk_Approved_Special_Leave.Value = 0 Then
Me.cbo_ASL_Type.Value = Null
Me.cbo_ASL_Type.Enabled = False
Me.txt_ASL_Start_Date.Value = Null
Me.txt_ASL_Start_Date.Enabled = False
Me.txt_ASL_End_Date.Value = Null
Me.txt_ASL_End_Date.Enabled = False
ElseIf Me.chk_Approved_Special_Leave.Value = -1 Then
Me.cbo_ASL_Type.Enabled = True
Me.txt_ASL_Start_Date.Enabled = True
Me.txt_ASL_End_Date.Enabled = True
End If
End Sub