Populate textbox based on combobox selection

笑着哭i 提交于 2021-02-16 14:49:27

问题


I am looking to update a textbox based on a combo box selection.

For example: If someone selects the word "Beach Holiday" from the drop down, then the text box will automatically populate with the word "Spain"

How do I do that?

I know I can do something similar to:

me.textbox = me.combo.column(1)

but that's not exactly what I am trying to do. Thanks in advance


回答1:


Configure your ComboBox to have two columns, with the width of the second column set to 0 so that it is not displayed.

Then, set the Control Source of your Text Box to

=[YourComboBox].Column(1)

The value of the Text Box will then automatically update without the need for Event handlers.



来源:https://stackoverflow.com/questions/40305833/populate-textbox-based-on-combobox-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!