If Chk False then Enabled=False

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
 
K

Ken Snell

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top