Enabling/Disabling Checkboxes

M

Mark Sheppard

I am trying to enable/disable elements of a form depending on whether a
checkbox is ticked or empty. With text boxes, this simply involves putting
conditional formatting on the relevent fields so if the checkbox field is
equal to 1, the field is enabled or equal to 0 and it is disables. However,
conditional formatting cannot e applied to checkboxes so I cannot use this
same method for enabling and disabling checkboxes. Does anyone know of the VB
required to carry out this function?

Many thanks in advance for your replies

Mark
 
T

tina

so you have a checkbox control (chkOne). based on whether chkOne is True or
False, you want to enable or disable another checkbox control (chkTwo). you
can use the following VBA code in the form's Current event procedure *and*
the AfterUpdate event of chkOne, as

Me!chkTwo.Enabled = Me!chkOne

note that you cannot use the value of chkOne to set the Enabled property of
chkOne, in chkOne's AfterUpdate event.

hth
 

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