Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2023, 07:33 AM
anxious-oracle's Avatar
anxious-oracle anxious-oracle is offline Auto-population and dependent dropdown list macro Windows 10 Auto-population and dependent dropdown list macro Office 2016
Novice
Auto-population and dependent dropdown list macro
 
Join Date: Oct 2023
Location: Mississippi
Posts: 1
anxious-oracle is on a distinguished road
Default Auto-population and dependent dropdown list macro

Hi, all. This is my first time working with VB, but I have a some experience with HTML and CSS and a little knowledge of C++ and Python. I use Microsoft for work and Linux Debian on my home machine, so this is a whole new world for me.



I'm trying to create a macro for work that will allow me to do the following:
  • Choose a county from a dropdown list
  • Automatically populate a county code
  • Populate a dependent dropdown list with the towns and cities in the county
I'm running into a few issues, such as the legacy dropdown form for Word 2016 allowing only 25 choices, and the code I have written for the default dropdown list doesn't work, since it's probably for the legacy form. I live in Mississippi, and we have 82 counties. I also don't know how to make an auto-populating text box based on a dropdown list choice. Is there a way to get around the limit, or is there a different method for creating the dependent drop-down list?

Any advice, guidance, links to learning material, and suggestions are welcome. I will be glad to post the code I have written for reference if needed.

Thanks!

Liz
Reply With Quote
  #2  
Old 10-31-2023, 06:14 AM
gmaxey gmaxey is online now Auto-population and dependent dropdown list macro Windows 10 Auto-population and dependent dropdown list macro Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Liz,


There is no limit to the number of entries that you can have in a ContentControl dropdown list. When you build your entries, you can assign the county name as the text property and the country code as the value property. Content controls have event procedures in the ThisDocument module of the document vb project. You can use the exit event to built your dependent city and town list entries in your dependent dropdown list.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply

Tags
dropdown list, microsoft word 2016, visual basic



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-populating dropdown list sylvio Word VBA 2 04-02-2023 02:45 PM
Creating an Auto-Generated Field dependent on Drop-Down List daft21 Word VBA 1 07-26-2021 05:54 PM
Link CC dropdown to dependent dropdown AND text box trailrunnertcm Word VBA 4 02-11-2021 08:04 AM
Auto-population and dependent dropdown list macro Populate Dependent Word Dropdown List from Excel Narcissus Word VBA 1 05-05-2020 02:55 PM
Auto population of a single date bremen22 PowerPoint 1 08-04-2014 11:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft