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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a Word Text Form Field 3

Status
Not open for further replies.

MinnKota

Technical User
Nov 19, 2003
166
0
0
US
I have designed a Form in Word 2002. One of the Text Form fields is bookmarked as APPRAISEE. It is the name of a person and I would like it to appear later in the document. How do I insert another field that references what has been filled in the APPRAISEE field?

Thanks
 
Make another text formfield named APPRAISEE2.

Write a little Sub that puts the result of APPRAISEE into APPRAISEE2

Sub PassToAppraisee2()
ActiveDocument.FormFields("APPRAISEE2").Result = _
ActiveDocument.FormFields("APPRAISEE").Result
End Sub

make that sub the exit macro for APPRAISEE. As soon as the user puts in something into APPRAISEE and moves on, the result will be updated into APPRAISEE2.

If you want the result to be used in a number of places, make a variable the result of APPRAISEE, then simply insert that variable into where ever you like, including the .Result of another text formfield.

Note that APPRAISEE2 could still be modified manually. Although you could also write an entrance macro that immediately exits (goes to next field). That way no matter when they tried to enter it, it would always exit. The results would always then come from APPRAISEE.

Therefore you may wish to:

run this type of conditional logic outside of the formfield completion - as a separate conditional logic procedure; OR

use {ASK} and {REF} fields - see Help.


Gerry
 
Place cursor where you want to repeat the Bookmark's text
Insert > Cross-reference
Reference type: Bookmark
Insert reference to: Bookmark text
For which bookmark: choose APPRAISEEfrom the list of bookmarks
Insert
Close
 
Fumei,

I used your idea and I unchecked the "Fill-in enabled" for Appraisee2. It works great.

Thanks
 
Is it possible to reference the field using a calculation? Instead of calculating anything, it would simply display the value.
 
Surely a simple REF field would be the easiest solution to implement: wherever you want the value of the 'APPRAISEE' boomark to appear, press Ctrl-F9 to create a pair of field braces, type 'APPRAISEE' between the braces, then press F9 to update. Note: this is in effect a shortcut way of doing what dcompto suggests.

If you set your Text Form field to calculate on exit, this should update all instances of the 'APPRAISEE' REF field throughout the document.

Cheers
 
That works well, but it doesn't update on the screen when the name is changed. It shows up fine on the print, but not the screen.
 
I'm not sure what you mean by display the value. Do you mean show the value as text at a certain location? Pop up a message box?

Depending on what you did exactly (my rather convoluted method, or the, ahem, better solution of cross-referencing back to the original) you may just need to simply refresh the fields.

Gerry
 
Is there a way to have the fields refresh without using a macro?
 
Actually, macropod's suggestion works fine on updating the screen for me.

As soon as the value/result is changed, the other field updates. In fact this is MUCH better than my solution.

The one draw back is that it is a direct relationship, not a logical one. My suggestion on using a sub to insert the information allows some logically processing: if formfield_A result = x, AND formfield_B result = y, then formfield_C result = z.

Anyway, I have my sub that updates the other text formfield, and it updates immediately on screen. I am not sure what the problem is. Are you willing to share the file?



Gerry
 
Just a little note to add to the wonderful tips in this thread. If you want your fields to update prior to printing, make sure that you have "calculate on exit" checked in the originating field. I could not get it to update until I had done that.

eg. I am writing a returned check letter. In one field, I wanted to write the amount the check was for, and then have it automatically add $25 to it for the returned check fee. I entered the formula and it worked, but didn't update on screen unless I checked the "calculate on exit" box in the properties window of the form field.

Hope this helps someone.

kawnz
 
I have a database tracking new employee information. I use a query to pull out new employee and their specific application needs(the application needs are check boxs). When I merge the two all of the check boxes on the merge document come in checked off. The query has only the applications I selected checked off. In Word 97 I was able to complete the steps below to create a check box however it's not working in 2002. Has the coding changed from below?
Any suggestions?
1. Open the main document for the mail merge and
place insertion point where you want the checkbox
to appear.
2. On the Mail Merge toolbar, click the drop-down
Insert Word Field button. Choose "If…Then…Else"
3. Under If, in the Field Name list, click to select
the field name that is the check box column in
Access (i.e. GW.)
4. In the Comparison list, click to select "Equal To."
5. In the Compare To box, type 0 (zero).
6. In the Insert This Text box, hold down the ALT key
and on the numeric keypad, type 0168 (make sure
numlock is on.)
7. The ¨ image appears. Select it and press CTRL + D
8. The font dialog box appears. Choose Wingdings and
then click OK. You should now see an empty check
box.
9. Under Otherwise Insert this Text, press ALT and
type 0254.

10. The þ image appears. Select it and press CTRL + D
11. The font dialog box appears. Choose Wingdings and
then click OK. You should now see a checked check
box. Click OK. Save your document.

Thanks so much in advance for any solutions given.
JJCPAC
 
Hi jjcpac,

Could you please repost this as a separate thread? I am not getting the connection to the original subject line re: text form fields. Your question deserves some attention and it may not get it, tacked on to this thread's subject.

Thanks.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top