Checkboxes in Templates

E

Erika

I am creating a template and I have fields that when filled in also fill in
other fields through out my document. I also have some checkboxes. Is there
was way that when a box is checked that other boxes further down in the
template will also automatically be checked.
 
D

Doug Robbins - Word MVP

Run a macro on exit from the checkbox that sets the .CheckBox.Value of the
other checkboxes to the .CheckBox.Value of the checkbox from which you are
exiting.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

The following code will set the CheckBoxes to which the bookmark names
Check2 and Check3 are assigned to the value of the CheckBox to which the
bookmark Check1 is assigned if it is run on exit from the Check1 CheckBox

With ActiveDocument
.FormFields("Check2").CheckBox.Value =
..FormFields("Check1").CheckBox.Value
.FormFields("Check3").CheckBox.Value =
..FormFields("Check1").CheckBox.Value
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

Erika

I have followed your instructions I have check1, check2 and check3 set up and
I have the macro set to run on exit of check1.

It keeps erroring on the first line of code
.FormFields("Check2").CheckBox.Value =
 
G

Graham Mayor

The lines have broken in the mail. You need to rejoin the lines for it to
work or use the following

With ActiveDocument
.FormFields("Check2").CheckBox.Value = _
.FormFields("Check1").CheckBox.Value
.FormFields("Check3").CheckBox.Value = _
.FormFields("Check1").CheckBox.Value
End With

See http://www.gmayor.com/installing_macro.htm



--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
E

Erika

Perfect, I didn't even pay attention I just copy and pasted the code. It
worked beautifully thank you both for your assistance.
 

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