Automatically check another checkbox if this one is checked

K

~KO

I am trying to do a macro that will automatically check boxes 17 and 20 if
5,6, or 7 are checked. Any simple solutions? I have Word 2000.
 
J

Jay Freedman

~KO said:
I am trying to do a macro that will automatically check boxes 17 and
20 if 5,6, or 7 are checked. Any simple solutions? I have Word 2000.

You really haven't given enough information, so I'll make these assumptions:

- The check boxes are form fields (from the Forms toolbar) in a protected
template.
- The name of each check box, as shown in its Properties dialog, is "Check"
plus the number you've given, such as "Check5". This is the default name
Word gives when you insert a check box.

In that case, paste this code into a module in the template:

Sub ExitCheck()
With ActiveDocument
If .FormFields("Check5").CheckBox.Value Or _
.FormFields("Check6").CheckBox.Value Or _
.FormFields("Check7").CheckBox.Value Then

.FormFields("Check17").CheckBox.Value = True
.FormFields("Check20").CheckBox.Value = True

Else
.FormFields("Check17").CheckBox.Value = False
.FormFields("Check20").CheckBox.Value = False

End If
End With
End Sub

Then go to the Properties dialogs of check boxes 5, 6, and 7, pull down the
Exit dropdown, and select ExitCheck for each one.

If the check boxes are from the Control Toolbox or in a userform (custom
dialog), post back for different instructions.
 
K

~KO

Hey Jay! Thanks so much it worked. Sorry about not supplying info. I know
enough to be dangerous lol. I have had to create this form in Word 2000 and
as an Outlook 2000 Custom form using control toolbar - so if you can send me
the macro to run the same thing for Outlook, I'd greatly appreciate it.

The reason I have to create both is time-constraints. I have put in a
request to have the add-in for printing forms in Outlook so I get the form
and not just text. If I can't get that soon, then I have to give the user the
Word form.
 
J

Jay Freedman

I'm glad I could help you with Word. In Outlook I'm like you -- I know just
enough to be dangerous. The objects in Outlook are different enough that my
knowledge of Word VBA doesn't get me very far. I think you'll have to ask in
an Outlook newsgroup for that.
 
J

Johnny

Jay, you indicated that the macro would be different for a userform. I'd be
interested in seeing what the programming would be for this. Thanks.
 
T

Tracy

I am also looking to the way to handle:

If the check boxes are from the Control Toolbox or in a userform (custom
 

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