enabling / disabling text box based on checkbox value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a text box which I would like to disable by default when it's parent
form is opened. Then, if the user clicks a checkbox (enables it) I would like
the text box to become enabled.

Can anyone please help me get this coded correctly?

Thanks,
Scott
 
In the "On Current" event of the form, type this...

If Not Checkbox1 then
Text1.enabled = false
Else
Text1.enabled = True
End If

Then, in the "After Update" event of the check box, type the same thing.
 
First you need to check the state of the checkbox. When checked its
state is True, when unchecked its state is False. The enable your
textbox according to the checkbox state. Your code might look like
this:

If Me!MyCheckBox = True Then
Me!MyTextbox.Enabled = True
Else
Me!MyTextbox.Enabled = False
End If

Hope this helps.
 
Back
Top