Enable/Disable Textboxes

T

Tom Bock

On a form, I have 5 check boxes. Under each textbox, I have a bound
control (data type = number).

Depending on the value of the checkbox (true/false), I want to
enable/disable the bound control.

For instance, if a box is checked, then the textbox underneath allows data
entry. If the same checkbox is unchecked, I want to erase the value
entered into the bound textbox AND also disable the bound textbox.

Does anyone know what the code is that I need to put into the AfterUpdate
event for each checkbox?

Thanks,
Tom
 
G

Guest

For instance, if a box is checked, then the textbox
underneath allows data
entry. If the same checkbox is unchecked, I want to erase the value
entered into the bound textbox AND also disable the bound textbox.

Does anyone know what the code is that I need to put into the AfterUpdate
event for each checkbox?

Thanks,
Tom

If Me!chkboxcontrolname = False Then
Me!txtboxcontrolname.Value = Null
Me!txtboxcontrolname.Enabled = False
Else
txtboxcontrolname.Enabled = True
End If

HTH
Kevin Sprinkel
Becker & Frondorf
 

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