Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking tables in ms word 2003

Status
Not open for further replies.

warnija

MIS
Jan 11, 2005
2
0
0
US
I am trying to link two different "cells" in two separate tables using MS Word 2003. For example I have two separate tables that are each 2x3. I need to have what I type in table A, column 1, row 1 appear in table B, column 2, row 1. Bascially I just have to be able to have what I type in table A, duplicated in table B in a different "cell". Is there a way to do this? I have been scouring the internet as well as the MS website to no avail. Any help would be greatly appreciated. Thanks.
 
you could define the content of each cell as a bookmark giving each cell a referencename eg A1 B2 etc..., then in the second table create a cross reference to a bookmark.

Ill keep thinking of a better way

cheers
Matthew

The only bad question is the question you dont ask!
 
Make the contents of the first cell a form field. Then in the second cell, press Ctrl-F9, and then type in the name of the form field(in the first cell). If the first form field is set to Calculate on Exit, then other field (the one in the second cell) will automatically update and always be whatever is the contents of the first one.

NOTE: the second location does not have to be a cell, it could just as easily be a chunk of text anywhere.

Gerry
 
Hello, warnija.

Phew, what a royal pain this was but I felt sure there was a way. Tought me some good stuff so thanks for the question.
[ol]1. Select the entire cell you want to have duplicated. In my example, it will be the cell in row 2 column 2 of table 2.
2. Give the cell a bookmark name. I used Tbl2Row2Col2.
3. In the cell you want to have duplicate information:
[ol a]a. Insert,Field to open the Field dialog box.
b. Scroll down in the field names section and select Link.
c. In the Filename or URL text box, enter your file name enclosed in quotes.
d. In the Class Name section, scroll down and select ‘Word.Document.8’.
e. In the Field options section, make sure that Update fields automatically and Insert object as text are checked.
f. Click on the Field Codes button down in the lower left.
g. Your field codes line should look similar to this: LINK Word.Document.8 “MyDocument.doc” \a \t.
h. Between your document name and the \a switch insert your bookmark name - in my example Tbl2Row2Col2
i. Your final field options line should look like this: LINK Word.Document.8 \"MyDocument.doc\" Tbl2Row2Col2 \a \t
j. Click OK.
[/ol]4. When you Alt-F9 to reveal field codes your destination cell should contain something similar to this: { LINK Word.Document.8 "C:\\Documents and Settings\\YourUserName.YOURCOMPUTERNAME\\PathToYourFile\\MyDocument.doc" Tbl2Row2Col2 \a \t }
[/ol]

Voila! Whenever you change the contents of the bookmarked cell, the destination cell will be updated with whatever the contents of the bookmarked cell are.


WARNING! New virus! [wink] Couch Potato Virus - Just sits there, eating chips all day.
 
Hi rocksandbroncos. I am sure it was a pain in the ass. I would be interested to hear from warnija if this is what was asked for. I read it as information between cells in different tables, but in the same document. It seems you have it linked to a location in a different file.

If it IS in the same file, simply doing a Ctrl-F9 and the name of the source form field (which of course is in fact a boomark) will work fine, and automatically. And it is much easier to set up. Not only that, but you can select and copy the updating field (the one you used Ctrl-F9 for); and paste it anywhere you like, as many time as you like. They will ALL update automatically.

Gerry
 
Hi fumei,

My solution assumed, and works when, there was no form being used in the document and the cells were in two different tables within the same document.

If he were using a form in the document, certainly it would be simpler to just reference the bookmark automatically assigned to a form field. In essence this is what I did by creating a bookmark for the origin cell.

Additionally, assuming that a form wasn't involved, there is no way to tell a cell within a table to 'calculate on exit'. The link field provides this functionality.

WARNING! New virus! [wink] Oprah Winfrey Virus - Your 200MB hard drive suddenly shrinks to 80MB, and then slowly expands back to 200MB
 
I wanted to thank both of you for your help on this problem. However whether it is due to my lack of Word knowledge or just plain misinterpretation I still cannot link the tables. Fumei, When I insert a text form field into the cell I right clicked it and went to properties. I checked the box to calculate on exit and I also saw it was named text1. I cannot however figure out how to make the second cell reference text1. Rocksandbroncs, I followed your instructions without any problems and came up with the result in step 4. However it still does not duplicate anything I type into the bookmarked cell. I have it set to calculate on exit but nothing happens. Do you know what might be causing this? Thanks for all your help.
 
From my post:
Make the contents of the first cell a form field. Then in the second cell, press Ctrl-F9, and then type in the name of the form field(in the first cell). If the first form field is set to Calculate on Exit, then other field (the one in the second cell) will automatically update and always be whatever is the contents of the first one.

The name of the first cell is, as you noticed, "Text1".

So, where ever you want to also display the result of the first form field (i.e. "Text1") you would:

go to the location you want that automatic result.
type Ctrl-F9
type the name of form field - in this case Text1

If the form field is set to Calculate on exit, the result will be automatically updated.

NOTES:

1. for form fields to function, the section they are in MUST be protected for forms. Tools > Protect document, and then select Forms. There is a Section button so you can selectively protect specific sections.

2. Protected sections can NOT be user edited. They can Tab between form fields and that is all. Repeat, the user has NO access to anything in protected sections.

3. Sections can be made quite small by using Continuous Section breaks. Insert > Break > Continous

4. It is a very good practive to explicitly name your form fields. You noticed that it is Text1. Suppose you had a bunch of reference fields (the Ctrl-F9 thing), and then put another text form field BEFORE the existing Text1, Guess what? Text1 would become Text2 and all you reference field would now point to the new Text1.

Word always names form fields in the CURRENT order in the document. If you explicitly name them - right click for Properties and rename its Bookmark - then any reference to that name will always work, regardless of its location.

So name your originating form field something that makes sense to what is going to go in it - Name, Address, BeerType...whatever, and use that name in the reference field.

Please see my FAQs on Form Fields; faq68-5299 faq68-5300

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top