New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding form controls for repeating data

From: Word 2007: Forms in Depth

Video: Adding form controls for repeating data

After the end of the last movie I went back and added the other nodes that we hadn't included to my schema. You can do that anytime you wish. Simply go back and open the Word Content Control toolkit, pull your template back in and make any adjustments you want to make. So it's easy enough to work with that. Make any adjustments you want to make. So now I have my Letter of Agreement that has the improved and attached schema here, and I'm going to show you how to copy the controls that we would like to have repeat. So, for example, we have a Choose a date control, now if you want to see these remember, you can go into Design mode, and then you can easily see the tags.

Adding form controls for repeating data

After the end of the last movie I went back and added the other nodes that we hadn't included to my schema. You can do that anytime you wish. Simply go back and open the Word Content Control toolkit, pull your template back in and make any adjustments you want to make. So it's easy enough to work with that. Make any adjustments you want to make. So now I have my Letter of Agreement that has the improved and attached schema here, and I'm going to show you how to copy the controls that we would like to have repeat. So, for example, we have a Choose a date control, now if you want to see these remember, you can go into Design mode, and then you can easily see the tags.

So that's a great way to do it. I told you that we'd lose our placeholders and that the new default text would come out of our XML schema and here it is. So I'm going to choose company short name. This is a two click process once on the tag, once on the title. And I'm going to copy this either Ctrl + C or go to the Home tab and choose Copy, and then I'm going to double-click and paste everywhere that shortname is going to go. I'd actually like to not include the space, but that's okay because a new space will be provided for me.

Notice that by default, the default paste behavior is to Keep Content Controls here, along with the formatting out of this document, the Source Formatting. You could, if you were copying to another document, match the destination formatting. But if you did that schema would already need to be attached for it to do you any good. Let's go ahead and continue to paste our shortname in here, many more times. This one's a little tricky because it's a possessive, so it's shortname apostrophe s. I'm just going to backup here by holding Shift and using the arrow key before I paste it in here again with Ctrl+V. And notice with these highlighted how quickly I can move through this document, putting all these duplicate fields in here.

Now here's the test. Let's go back to the Developer tab and turn off Design mode. What we really want to know is if I select and enter a new shortname, for example, Two Trees Oil, and tab out of this field and look at this. Here, here, here, here, all these locations, all of them changed. I'm going to go ahead and do service type as well, so you can see how this works. I'm going to say, Choose a service, click on the tag.

It helps for me to be in Design mode so I can see clearly what I'm doing. I'm going to copy this and paste it into service type here, double-click, and here. Notice again how nice it is to have tags with no spaces in them so that double-click works for us. Let's exit Design mode and when I choose a service here, like business analysis, notice here and here it's changed as well. So simply by mapping the schema, binding the schema to those initial controls, and then using those bound controls to copy through this document, I have a set of controls that work together.

I don't have to go back to the first one to change the value. If I choose this one and change it from Business Analysis to Technical Writing, all of them will change; they are peers. Even though they were all copied from this first one, I don't have to change this one to make the change. If I choose my Choose start date field and copy it, I can put it here, and finally I think the last choice I have is Company Legal Name which I can copy from here, oh one more service type I missed, down to here.

I'll trust you to go ahead and clean the rest of these up if there are any more left to do. Now you'll notice that you can still click anywhere in the document; this document isn't quite done. We have one more thing to do before it would be completely finished and we would protect the document to restrict formatting and editing and only allow Filling in of forms, choose Start Enforcing Protection and say OK. We'll be in a great position now because I can tab from control to control, now that I've turned the protection on, it's really easy for my users to tab through and see what they're doing.

Notice that the date changed. When I change one, both of them change; it works great. This is a fabulous form. No matter how long this form gets, it's going to behave just like this. So I can go in, enter my information really early on in the form and make sure that it flows all the way through. A couple of other tips I want to just toss your way before we finish this fabulous repeating controls form. Sometimes when people are typing in this default text over in the schema, they will put it all in caps so that it stands out from the other text that was here.

You can see how that would work for you. You know, if what we had here rather than enter short name, was it said ENTER SHORT NAME. Even if I'm not tabbing from field to field, those tend to jump out at me pretty nicely. And you'll notice that the control worked, because they all now say ENTER SHORT NAME. So a lot of steps to go through and creating the schema field is a little strange the first time, but by and large this is a great way to create an incredibly powerful form that you would otherwise have to copy and paste text into repeatedly.

You can combine these two techniques that we've seen in the last chapter, the building block techniques with the dropdown list, with the repeating controls that we have here. So you can have someone choose from a dropdown list and have the contents of that content control that was pulled out of the Quick Parts library repeat elsewhere in the document.

Show transcript

This video is part of

Image for Word 2007: Forms in Depth
Word 2007: Forms in Depth

28 video lessons · 5853 viewers

Gini Courter
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.