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
 
L

Linq Adams via AccessMonster.com

You'll also need the same code in the Form_Current event in order for the
formatting to persist as you move from record to record.
 
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.
 
Top