View Full Version : [SLEEPER:] How to auto-populate fields based on the checkbox status in Microsoft Word
Prasasti
12-18-2023, 11:13 AM
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
Chas Kenyon
12-18-2023, 12:13 PM
I assume you mean you are using Content Controls and not legacy form fields.
If in Windows, consider using a UserForm.
Create & Employ a Userform by Greg Maxey
(http://gregmaxey.com/word_tip_pages/create_employ_userForm.html)
See Link "Conditional Content" to a List Selection (https://gregmaxey.com/word_tip_pages/link_content_to_dropdown_list.html), Content Control Custom Events by Greg Maxey (https://gregmaxey.com/word_tip_pages/content_control_custom_events.html), and Insert Content With Content Controls by Greg Maxey (https://gregmaxey.com/word_tip_pages/insert_content_with_content_controls.html).
See also: Conditional Text using IF fields and Content Controls - Microsoft Community (http://answers.microsoft.com/en-us/office/forum/office_2010-word/conditional-text-using-if-fields-and-content/9d131482-b87f-40e7-824d-43e645fd9e42?page=2)
Prasasti
12-18-2023, 06:49 PM
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.
31270
gmaxey
12-19-2023, 04:09 AM
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?
Prasasti
12-19-2023, 12:44 PM
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.
Chas Kenyon
12-21-2023, 08:07 PM
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.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.