Enabling TxtField on Checkbox

  • Thread starter Thread starter MJ
  • Start date Start date
M

MJ

I have a form that has several text fields that begin DISABLED when opened.
When the user answers the questions by checking a Yes or No checkbox, I want
the text field enabled if they check NO.

What is the bext/easiest way to make it happen?
 
Assuming that these textboxes are not in a datasheet or continuous form, use
code similar to:

Sub chkWhatever_AfterUpdate()
If Me.chkWhatever = True Then
Me.txtControl1.Enabled = True
Me.txtControl2.Enabled = True
Else
Me.txtControl1.Enabled = False
Me.txtControl2.Enabled = False
End If
End Sub
 
Actually, you can run it again in the form's Current event, by simply
calling it like:

chkWhatever_AfterUpdate

So you needn't add the entire code again.
 
Back
Top