troubleshooting Question

coding for Radio(option) button & check boxes

Avatar of urjudo
urjudoFlag for United States of America asked on
Microsoft Access
3 Comments1 Solution17 ViewsLast Modified:
Hi Experts,
I have a question about the option button and check boxes.  I have a form that has two option buttons and four check boxes
optA  & optB  -- > option buttons
ckb1, ckb2, ckb3 & ckb4  --  > check boxes

here is the details:
users can select either optA or optB
users only can select ckb1 or/and ckb2 and ckb3& ckb4 will be disable or ckb3 or/and ckb4 and ckb1 & ckb2 will be enable
I got this part works.

so when a user select optA and check ckb1 & ckb2 then ckb3 & ckb will be disable, what I want to to is if that user change her mind and select optB, I want ckb1 & ckb2 uncheck and ckb3 & ckb4 enable?  


I set all the check boxes lock = true (users have to select the option button before they can check the check boxes)
I have my code in both optA & optB on click:
  If optA = true then
     ckb1.locked = false
     ckb2.locked = false
     ckb3.locked = false
     ckb4.locked = false
 else
     ckb1.locked = true
     ckb2.locked = true
     ckb3.locked = true
    ckb4.locked = true
     ckb1..defaultValue = false
     ckb2.defaultValue = false
     ckb3.defaultValue = false
     ckb4.defaultValue = false
 end if

  If optB = true then
     ckb1.locked = false
     ckb2.locked = false
     ckb3.locked = false
     ckb4.locked = false
 else
     ckb1.locked = true
     ckb2.locked = true
     ckb3.locked = true
    ckb4.locked = true
     ckb1..defaultValue = false
     ckb2.defaultValue = false
     ckb3.defaultValue = false
     ckb4.defaultValue = false
 end if

this seems not work as I want to, I have to uncheck the ckb1 and ckb2 then ckb3 & ckb4 will enable.  am I missing something?

Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros