?
Solved

Text Box Auto Copy to Another

Posted on 2006-06-21
1
Medium Priority
?
365 Views
Last Modified: 2008-02-01
Hello,

I am having trouble figuring out how a Word macro/subroutine/or other method can copy a value from one text box filled in on a form to another text box on same form.

I need the user to fill in his name on page one of a form and then have that name apear in another text box on page two automaticaly.

I have Googled this to death, but to no avail.

Thanks in advance.

0
Comment
Question by:kchrisc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 400 total points
ID: 16955923
Since you mention a form, I presume that you are talking about text form fields, as opposed to a text box from the Insert menu.

This macro will copy from one text form field (Text1) to another (Text2).

Sub CopyTextBox()
    ActiveDocument.FormFields("Text2").Result = ActiveDocument.FormFields("Text1").Result
End Sub

Create the macro, then make it the Exit macro in the first form field.


Note that if there is no need to edit the repeated information, you could replace the second field with a Ref field using the name of the first form field. If you display the field codes, it will look like this.

{ Ref Text1 }

Tick 'Calculate on exit' in the form field's options(properties) window to ensure that the Ref field is updated immediately.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question