根据组合框选择填充文本框 [英] Populate textbox based on combobox selection

查看:52
本文介绍了根据组合框选择填充文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望根据组合框选择更新文本框.

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"

我该怎么做?

我知道我可以做类似的事情:

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

推荐答案

将 ComboBox 配置为有两列,第二列的宽度设置为 0 使其不显示.

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

然后,将文本框的Control Source设置为

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.

这篇关于根据组合框选择填充文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆