Enabling TxtField on Checkbox

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?
 
A

Arvin Meyer MVP

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
 
A

Arvin Meyer MVP

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.
 

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