locked
Replicate Fillable Fields RRS feed

  • Question

  • Hi - I am running Word 16. I've created a form with fillable fields (using the Developer tab), however, I want to make it so that the fields replicate. For example, if you use one of the fields to enter an address, I'd like it to appear in every other address field across the document so you don't have to type it more than once. Is that possible?

    Also, is there a way to make it so that using the "tab" key will jump from field to field?

    Thursday, December 5, 2019 8:11 PM

All replies

  • Hi,

    In my opinion, you can try to record a macro code and add it to Quick access toolbar.

    https://www.webucator.com/how-to/how-add-macro-the-quick-access-toolbar-microsoft-excel.cfm

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Please try this method and let me know if this will help you.

    Regards,

    Emi Zhang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Friday, December 6, 2019 9:56 AM
  • This simplest way to implement this is to have a set of formfields at the top for entering the information. Each of those formfields includes an Exit macro that copies the information to each of the similar formfields in the document. Right-click on a formfield and choose Properties to see the field where you set the macro. Here's the code:

    Sub TransferInfo()
        Dim UserName$
        UserName$ = ActiveDocument.FormFields("Text1").Result
        With ActiveDocument
            .Unprotect
            .FormFields("Text2").TextInput.EditType Type:=wdRegularText, Default:=UserName$, Enabled:=True
            .Protect Type:=wdAllowOnlyFormFields, NoReset:=True
        End With
    End Sub

    If you want to be able to enter the information in any form field and have it repeat, you will have to include exit macros in every formfield.

    To make the macros work and to enable tabbing among fields, you must protect the document for forms. On either the Review or Developer tabs, click on Restrict Editing, check the box beside Allow only this type of editing in the document, then change the dropdown to Filling in forms, then click on Yes, Start enforcing Protection. I don't recommend using a password, that just makes the programming more complicated.

    Here's a sample document with 2 formfields and a sample exit macro: Sample Form

    You also might want to check out Content Controls instead of formfields, their more flexible and you don't need a macro to transfer information among them: Repeating Data Using Document Property Content Controls

    • Edited by jkorchok Friday, December 6, 2019 2:21 PM
    Friday, December 6, 2019 2:17 PM
  • Use Mapped Content Controls. They immediately update.

    These can be either the built-in Document Property controls or ones that you map yourself.

    Repeating Data Using Document Properties Content Controls and Other Mapped Content Controls

    Tab key:
    You need to somehow protect your form and use plain text rather than rich text controls. (The rich text controls allow use of the tab within the control to space text.) I recommend selecting the entire form and grouping it. In that way the only things that can be changed are the Content Controls.

    Create a Form Using Word Content Controls by Greg Maxy, MVP

    The other responses seem to be about legacy formfields. There can be times when using such formfields is required but it really limits other Word functions. Protecting such a form, you use the protection for filling in forms. Again, that is the most restrictive. Making Forms with Microsoft Word


    Charles Kenyon Madison, WI



    Friday, December 6, 2019 7:32 PM
  • This simplest way to implement this is to have a set of formfields at the top for entering the information. Each of those formfields includes an Exit macro that copies the information to each of the similar formfields in the document. 

    Hardly. All one need do is check the formfields' 'calculate on exit' property then insert cross-references to them wherever else the data are to be replicated. No macros required.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Saturday, December 7, 2019 3:42 AM
  • Thanks for your contribution. I may not have expressed it clearly: it's simpler to implement a single set of formfields at the top of the form where you enter the information, as opposed to the O.P.'s idea of enabling entry in any formfield that will than update all others in the form.
    Saturday, December 7, 2019 6:05 PM
  • On my reading of the OP's problem description, enabling entry in formfields anywhere in the document is not implied. The document may have been set up that way, but that probably only reflects ignorance of the approach I suggested - which is also far simpler to implement and maintain.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Saturday, December 7, 2019 9:00 PM