Can I make a field active/inactive with a check box?

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

Guest

Hello everyone I am creating a form for record reviews and on the form I have
a check box labled correction (yes or no) and a text field labeled correction
detail. I would like have the correction detail field active only when the
check box is checked. I have several of theses on one form can somone give me
some adivce on how to proceed? I know I need to run an update command but do
not know how to. Clay
 
If i can understand you, it's simple.
write a code under click event of the checkbox to enable the appropriate
textbox, i.e
all your textbox depending on a chekcbox should be initally disable.
hope it hel
wunti
 
Clay,

You could place the following line of code behind the clickevent of the
checkboxes:

me.textbox.enabled=me.checkbox

This way the textbox is enabled if the checkbox is enabled. Make sure the
defaultvalue for you checkboxes are set to 'no' or 0 (zero). You have tor
replace the textbox and checkbox names with your own controlnames ofcourse.
If it is unclear let us know we'll guide you through...

hth
 
Thank you for the assistance.

Maurice said:
Clay,

You could place the following line of code behind the clickevent of the
checkboxes:

me.textbox.enabled=me.checkbox

This way the textbox is enabled if the checkbox is enabled. Make sure the
defaultvalue for you checkboxes are set to 'no' or 0 (zero). You have tor
replace the textbox and checkbox names with your own controlnames ofcourse.
If it is unclear let us know we'll guide you through...

hth
 
Maurice, here is what I tried
Clay,

You could place the following line of code behind the clickevent of the
checkboxes:

me.textbox.enabled=me.checkbox

This way the textbox is enabled if the checkbox is enabled. Make sure the
defaultvalue for you checkboxes are set to 'no' or 0 (zero). You have tor
replace the textbox and checkbox names with your own controlnames ofcourse.
If it is unclear let us know we'll guide you through...

hth
 
Could be two options

1. You have to set your macro settings under Tools options security. There
you can set the option to low. Access settings as set to normal (meaning you
will be notified).

2. Make sure you place the code under the [code builder] option and not the
macro option of the control.
Click on the three dots next to the click event. Choose [code builder]
type the line of code, click save and close the VBA-editor by clicking the
closebutton. Then open the form in formview and try again.

hth
 
Back
Top