PDA

View Full Version : Help in Word 2002 Forms with VBA



vespertina
06-10-2011, 09:03 AM
Hello! This is my first post here, so I'm sorry if I break any rules or commit any faux pas!

I am working on a form in Word for my job at a legal office. It is two pages, with the first page being a subpoena and the second being an affidavit of service. Basically, the first is the page we serve on someone, and the second is the page the server fills out to prove he gave it to them. There is a lot of information that is the same on both pages (case information, file numbers, etc.) and I was hoping VBA could help make this a quicker process.

What I'm looking for is the ability to enter information in a Text Form Field on the first page, and have that automatically appear in a Text Form Field on the second page. That way we only have to enter all the information once, and it will autofill on the second page.

Alternately, I was wondering if it's possible to have a Dropdown Form Field on the first page and, when I choose an item from the Dropdown, that same item automatically appears in a field on the second page (either a Text or Dropdown field, I don't care which).

The only coding I've been able to find with web searches is cascading dropdowns, which means if you choose an option in Dropdown 1 then Dropdown 2 is populated with certain specific options. That's not exactly what I'm looking for - I need more of copying/autofill than differing options.

Sorry for such a ton of information, I'm just trying to be as clear as I can! If anyone can be help, I'd greatly appreciate it - and if it's just a link to an old post where this was already answered, that's totally cool by me. I tried to search for my answer before I made a new post and couldn't find anything.

Thanks again!

Leigh

Frosty
06-10-2011, 12:27 PM
You don't need VBA to do this, I don't think.

I don't have Word 2002, but this has been a feature for a long time, so I believe you should have it.

Name all of your formfields with a specific name (like "bkCaseInformation") on the first page.

On the second page, Insert > Field (and look for the field called Ref)... it will let you insert a field which automatically updates to whatever you've filled out in your formfield above.

Hope that helps!

- Jason

vespertina
06-10-2011, 12:39 PM
I've tried that, but it only updates to whatever is filled at that moment. Meaning that if I change the dropdown menu option in the first field, the Ref Field doesn't update to the new one. I would have to delete the Ref field and re-insert it. Which sort of defeats the time-saving purpose. :) Is there a way to force the Ref Field to update? If so that would solve the problem, but otherwise I think that's why I need VBA.

Thanks for the help, though! Any other help you could give would be appreciated!

Frosty
06-10-2011, 12:42 PM
Fields update at odd times... especially when you're doing protected documents. This is one of the areas where the version could really matter.

But have you:
1. Tried switching to normal view and back to page layout view
2. Switching to print preview
3. Printed out the document
4. Closed and re-opened the document

Just because it doesn't update when you switch the answer in the drop down doesn't mean it won't update before it really "matters" (i.e., printing, when someone else opens, etc).

vespertina
06-10-2011, 12:48 PM
You are officially my hero. Holy crap. I can't believe it was that easy. The print preview thing worked!

Thanks so, so much, I can't even begin to tell you how many hours I've spent fighting with this. I appreciate all your help!

Frosty
06-10-2011, 12:56 PM
As my fifth grade teacher used to say: it's always easy when you know the answer!