Consulting

Results 1 to 6 of 6

Thread: How to auto-populate fields based on the checkbox status in Microsoft Word

  1. #1
    VBAX Newbie
    Joined
    Dec 2023
    Posts
    3
    Location

    How to auto-populate fields based on the checkbox status in Microsoft Word

    Hello,
    I am trying to auto-populate certain fields in the form based on what was entered in another section IF a checkbox is checked. So for example, if the "Same as Bill To" checkbox is checked, I want the name from the Billing Section to auto-populate in the Shipping section. But if it's left unchecked, I want the name in the Shipping section to be blank. Is there a way to do that in Word? If so, how would I go about doing that? Also, is there a way to make drop-down a mandatory field?
    Best Regards,
    Prasasti

  2. #2

  3. #3
    VBAX Newbie
    Joined
    Dec 2023
    Posts
    3
    Location
    Hi Chas,

    Yes, I'm using Content Controls in windows. Sorry, but I'm not familiar with VBA at all. If billing information is entered (red box area), AND "Same as Bill To" checkbox is checked, I want that billing information to auto-populate in the shipping information section (blue box area). If the checkbox is left unchecked, I want the shipping information section to be blank. Also, I was wanting the Shipping Drop-down (green area) to be required.
    client order form.jpg

  4. #4
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,362
    Location
    The simplest solution would be an on exit event of the checkbox content control. E.g.,:
    If Checked then
    ... set the value of the blue box CCs to the same as values as the red box CCs
    Else
    ... do nothing
    End If

    Simple would require the user to "exit" the checkbox. Are you certain your users will allow VBA code to run?
    Greg

    Visit my website: http://gregmaxey.com

  5. #5
    VBAX Newbie
    Joined
    Dec 2023
    Posts
    3
    Location
    Is there a way to do an "on exit event" with Content Control Check Box, or does it need to be Legacy?
    what would the code be for that? Also, can this be done without VBA or is that the only option? I'm not 100% certain the users will allow VBA code to run.

  6. #6
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    123
    Location
    vba is the only option, in my opinion. Greg has told you how to do it with a Content Control, not a legacy formfield.

    You could do it with bookmarks and REF Fields inside IF Fields which would require that your user update fields.
    Last edited by Chas Kenyon; 12-21-2023 at 08:38 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •