VB unlock a checkbox after other box checked

sl1nger
sl1nger used Ask the Experts™
on
I'm using an access form and vb in the back.   On the form, I have 2 checkboxes, chkA and chkB.   I have chkB set lock equals Yes on the form.  

I need chkB to be unlocked after chkA is clicked.    

This is what I have in the code: (but it's not working)

Private Sub chkA_Click()
If chkA.Value = True Then
    chkB.Enabled = False
End If

End Sub



Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I think it should be (but you'll need to try this)

chkB.checked=False

I think setting chkB.enabled=False disables the chkB check box rather than removing the check.
It sounds to me like you want:

chkB.Enabled = True

rather than your current line which is:

chkB.Enabled = False
try that

Private Sub chkA_Click()
If me.chkA.Value = 1 Then
'if you want chkb to uncheck remove the ' from the next line
'me.chkB.value =0
    me.chkB.Enabled = False
End If
if me.chkA.Value = 0 then

'if you want chkb to check remove the ' from the next line
'me.chkB.value = 1
me.chkB.enabled= true
end if

End Sub

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial