Link to home
Start Free TrialLog in
Avatar of StephanieFoster
StephanieFosterFlag for United States of America

asked on

Delete or Hide Unselected ActiveX Checkboxes in Word Form

I have a form I am trying to create that has checkboxes and then sections related to each checkbox.  I tried using a drop down and I could never make the selection run a macro like I wanted, so went to checkboxes instead.  

My form has 5 checkboxes and 5 related sections.  If a person checks checkbox 2 - it automatically deletes sections 1 and 3-5 leaving only section 2 to fill in.  I used ActiveX checkboxes because the text is built in.  I used Legacy text boxes because I wanted to manipulate the max size.   I have found macros to make the deletion of sections work because I don't know anything about writing macros or VBA except the snippets I've found on the web.  The current macros  work very well!  

i'm trying to make this as user friendly as possible.  The staff i work with work wth people, not computers so much...  So the last thing I want to do is "hide" or delete the checkboxes that are not selected so the end user won't get an error if they try to select more than one.  Because once one has run, it can't run another.  And if there was a way to pop up a message vs the error message when/if they try to deselect their choice or not even allow to uncheck once selected.    I have tried several different lines in my macros, but obviously, I have no idea what I am doing, because I get errors and help just leaves me more confused.  

Maybe there is no way to do what I want to do.  If so I just need to train them again and if they mess up they have to start over... :)
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you attach an example file
Look at MS or Google forms. They have options for going from section to section dependent on answers.
Open the userform in this document. It will allow you to run various macros from a list. If you need any of the code explained please let me know.
29144142.docm
Avatar of StephanieFoster

ASKER

Attached is my sample form.  I guess I didn't use a UserForm after all.  I just created fields so maybe I did it wrong.
CIS-sample-Doc.docm
Please describe again exactly what you want to have happen if for example 'Transfer InQLC' is checked. It appears that one thing you want to do is to delete the other checkboxes which if you then save the doc means that they are gone for good. Do you really want to do that?

In the doc I supplied above I used an actual userform. Even if you don't want to use one, would you like to be able to use a list rather than the checkboxes?
yes, my original plan was to use a drop down list vs checkboxes but I could never get the form to unlock to allow the deletion of the section. But i was just using the legacy with a macro called drop down delete that I thought called other macros.  I tried the unlock code before the drop down delete, after, before each called macro and I just gave up!  But I am using your sample to try to do use a userform with drop down to see if that will work.  

Even if I can just hide the check boxes, or make them so people can't check another as I don't want them to run into errors.  I like to keep things as simple as I can for them.  

Thank you for taking the time to look at this for me.
Stephanie
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is it!  I just thought deleting would get rid of any chance of filling out something else wrongly.  it's not a complex form for us - but used quite often and needed updating.  I wanted to  change from just a simple fill in a blank with all sections showing.  Sometimes I overthink things, so I truly appreciate your time helping me with something I know very little about.
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you. Most are aimed at Excel and VB6 but there is some carry-over to Word.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
              Experts Exchange Top Expert VBA 2018
              Experts Exchange Distinguished Expert in Excel 2018