Share via

Conditional Formatting on Form Fields (Specifically Check Boxes)

Anonymous
2015-02-25T21:10:10+00:00

I am creating a form for people to fill out with resume information.  I have built a table with form fields (Plain Text Content Controls) like Name, Company, Position Title, Start Date, End Date, etc.  Sometimes, people need to enter multiple start/end dates, position titles, etc. because they were employed in more than one position while at the same company.  So, I have a section that says, "Did you hold more than one position while at this company?" with Yes and No check boxes.

Is there a way to add conditional formatting to the check boxes?  If someone checks yes, I would like to have additional "sets" of table rows/form fields appear for the additional position(s).  If the person checks no, I'd like to hide those rows/form fields.  I've looked all over online, and I can't figure out how to do it, or if it's even possible.

Does anyone know how to do this/if it's possible, and if so, can you help me out?

(It'd be nice if I could take it one step further and, if the person checks "Yes," have a box appear for them to enter how many positions.  Then, have that many "sets" of position questions show up.)

Please realize that I'm very good at working with the other aspects of Word, but am a novice at creating forms and working with macros.  So, please try to describe things thoroughly, and be patient with me. :)

Thanks!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2015-02-25T23:24:15+00:00

    I would not refer to what you want to do as Conditional Formatting.  However, if you were to create an AutoText Entry that contained the required table row and its contents, you could use code such as the following in the This Document object

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)

    Dim i As Long

    With ActiveDocument

        For i = 1 To .ContentControls.Count

            If .ContentControls(i).Tag = "CheckYes" Then

                If .ContentControls(i).Checked Then

                    Selection.Tables(1).Range.InsertAfter .AttachedTemplate.AutoTextEntries("Name of AutoText Entry")

                    .ContentControls(i).Checked = False

                End If

                Exit For

            End If

        Next i

    End With

    End Sub

    Take a look at Greg Maxey's website for more information on working with Content Controls

    http://gregmaxey.mvps.org/word\_tip\_pages/content\_controls.html

    Was this answer helpful?

    0 comments No comments