If Chk False then Enabled=False

  • Thread starter Thread starter Donna Brooks
  • Start date Start date
D

Donna Brooks

I have a subform that has a check box called chkMedExc
and a combo box called cmbReasMedExc. If the value of the
check box is false, I do not want the combo box to be
enabled and if possible the value of the combo box to
be "Not Medically Excluded". I don't know where to put
this code or the correct syntax. Could someone please
help? Thanks in Advance, Donna Brooks
 
You might use the OnCurrent event of the subform:

Private Sub Form_Current()
Me.cmbReasMedExc.Enabled = Me.chkMedExc.Value
If Me.chkMedExc.Value = False Then Me.cmbReasMedExc.Value = "Not
Medically Excluded"
End Sub

Note that the above code will error if the combo box has the focus when a
record becomes active.
 
Back
Top