WD2000: How to Update Fields in a Protected Form (212356)
The information in this article applies to:
This article was previously published under Q212356
For a Microsoft Word 2002 and Microsoft Word 2003 version of this article, see 291474.
For a Microsoft Word 98 Macintosh Edition version of this article, see 187816.
SUMMARY
Fields in a document that is protected for forms may not be updated when you fill
out the form. This article describes four methods that you can use to update
regular fields or to automatically insert and update the result of one form
field into another area of a form.
MORE INFORMATIONMethod 1: Use the "Calculate on Exit" Option
In Word 2000, form fields include a Calculate on exit option. When you turn on this option, fields and form fields can be updated in a protected form document.
Fields not updated by this switch include:
For additional information, please see the following article in the
Microsoft Knowledge Base: 212244 WD2000: How to Use Calculate on Exit in a Forms Document
Method 2: Use a MacroMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
The following macro can be used as an on-exit macro for the first form field, which is called "Text1", so that the information entered into this field automatically appears in the form field called "Text2." Alternatively, the macro can be used as an on-entry macro for the second form field, which is called Text2. When you use the TAB key to move to this second field, the result of the first form field is placed automatically as the field result of this second field.
Sub OnExitMacroExample()
With ActiveDocument
.FormFields("Text2").Result = .FormFields("Text1").Result
End With
End Sub
In this example, "Text1" and "Text2" are bookmarks. The Text1 bookmark represents the field that contains the information that you want to automatically appear in the field that is represented by the Text2 bookmark.
For each field that receives the information automatically, clear the Fill-In Enabled check box in the Text Form Field Options dialog box. This minimizes the chance of accidentally modifying the field result.
Method 3: Reference a Form Field Entry Elsewhere in a Document
There may be times that you may want to reference a form field entry
elsewhere in a document.
To repeat a form field entry using a reference field, follow these steps:
- Position the insertion point where you want the data to be repeated.
NOTE: The document (or section where the insertion point is) must be unprotected to insert a field.
- On the Insert menu, click Field and select REF from the Field Name list.
- In the Field Code box, insert the form field bookmark name (for example, text1) that represents the form field into which you are entering the data.
- Click OK.
The REF field must be updated to display and print the text. An update includes all fields such as DATE and TIME. There are two ways to update fields in the protected area of your form: NOTE: Because this exit macro may cause a slight delay on some computers, you may choose to select the Update Fields on printing option if this is to be a printed form. You may also choose to select the Calculate on exit option as described in Method 1.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbfield kbForms kbinfo kbmacroexample KB212356 |
---|
|