I have 3 values in a combo box with value1-ID1, Value2-ID2 and Value3-ID3 and I have another 3 combo boxes A, B, C. what I am trying to do is if value2 is selected then disable combo boxes A and if value 3 is selected then disable combo box B and C and I am using this code
Code:
Private Sub EnableDisable1(Argument As Boolean)
Me.Prepare1.Enabled = Argument
End Sub
Private Sub EnableDisable(Argument As Boolean)
Me.Prepare2.Enabled = Argument
Me.Present2.Enabled = Argument
End Sub
Private Sub Reason_AfterUpdate()
If Me.reason = 1 Then
EnableDisable (True)
Exit Sub
End If
EnableDisable (False)
Exit Sub
If Me.reason = 2 Then
EnableDisable1 (False)
Exit Sub
End If
EnableDisable1 (True)
Exit Sub
If Me.reason = 3 Then
EnableDisable (False)
Exit Sub
End If
EnableDisable (True)
Exit Sub
End Sub
Private Sub Reason_AfterUpdate()
If Me.reason = 2 Then
Prepare1.Enabled = False
End If
If Me.reason = 3 Then
Prepare1.Enabled = False
Present1.Enabled = False
End If
End Sub
but what's happening is if I select value 2 value 3 selection function doesn't work and vice versa. Meaning If value2 selected combo box A will be disabled however when I choose value3 then combobox A and B doesn't work as required