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

Word 2007 Forms

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
How do I create a form field on the second page of a word 2007 doc that is automatically filled in with a previous form field entry on the first page?

Thank you,

Dawn

 
Make the first (or any) formfield Calculate on Exit.

Do not use a second formfield. Why, if you the user is not filling it in.

Make the second field a, well. field. Make to refer to the first one.

Say the first one is named "Client", or to use the default for a text formfield. "Text1".

Go to where you want its value duplicated.

Press Ctrl-F9
Type in Text1

Now move the cursor. if text1 has Calculate on exit, when you exit out of Text1, its value will be placed into the othe rfield. You can do this as many time, and as many place as you like.

If must have the second one a formfield, so th euser can change it, then you can make an OnEntry macro for the second formfield. Like this:
Code:
Sub MyOnEntry()
ActiveDocument.FormFields("Text2").Result = _
   ActiveDocument.FormFields("Text1").Result
End Sub
So now, on entry, its result will be the rsult of Text1, but you can change it.

< 60 50 working days until retirement
 
That is what I thought but when I do that it says "Error! Bookmark not defined. Error! Reference source not found." I get that error when I lock the form and type something in the first field and then tab, instead of putting that text in the reference field it gives me that error instead.

 
Actually, I didn't understand what you meant by "Make the second field a, well. field. Make to refer to the first one."

 
OK, first of all, it is not a good idea to state bookmark, when you mean formfield. Is the formfield copied? Does it HAVE a bookmark? Copied formfields do not have bookmarks. You can still refer to the formfield, but not a bookmark.

Where do you get this error? With:
ActiveDocument.FormFields("Text2").Result
????


Second, the second field is a manually entered field, that is, it you manually put it in the document.

That is what happens when you press Ctrl-F9. It puts in an empty, blank, field. You can see the curly brackets of a field. You MUST use Ctrl-F9 to do this. When you type the name of the first formfield into this new empty field, it make the field point to that first formfield. It refers to that formfield.

< 60 50 working days until retirement
 
I am not quite sure what you are saying. Here is what I did. I created a form field with the name of the Bookmark field filled in Text Form Field Options Box. (also, calculate on exit is checked.) Then I went to the part of the document where I wanted to repeat the text that gets entered in the form field, and I did CTRL-F9 and got the curly brakets. And typed in REF CaseName inside the brackets. CaseName being the bookmark name I gave the original form field. Then I locked the document and tested it out by typing something in the first field, and the second field showed the error that I told you about.

 
Hi Dawn,

That suggests there is a mis-match between the boorkmark's name and the name you've used in the REF field.

Cheers
Paul Edstein
[MS MVP - Word]
 
Here is what finally worked. I took out the REF in the reference field and just put in the bookmark name and it worked like a charm. I guess 2007 doesn't need the REF anymore? Thank you both for your attempt to help.

Dawn

 
Here is what finally worked. I took out the REF in the reference field and just put in the bookmark name and it worked like a charm. "

Did I suggest putting in REF? Nope.

Say the first one is named "Client", or to use the default for a text formfield. "Text1".

Go to where you want its value duplicated.

Press Ctrl-F9
Type in Text1

< 60 50 working days until retirement
 
No, I didn't say you suggested it, I was just reporting what finally worked for me. :)

 
But why did you put REF in there, in the first place? What made you think you should put in REF?

< 60 50 working days until retirement
 
I saw it elsewhere when I was looking for the answer and thought it was how it was done in previous versions. I can't remember what site I found it on now.

 
Well, regardless, I am glad you got it working, finally.

< 60 50 40 working days until retirement; with 87 accumulated sicks days. Know what? I am not feeling well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top