excel vba 自动填充文本框
还有一个问题。我为客户设置了一些表格,并且多个表格上需要一些数据。用户将在客户端选项卡上输入客户端名称和客户端 ID。当他们打开新表单输入财务信息时,我有一个包含新创建的客户名称的组合框,并且希望根据客户名称自动显示客户 ID。我使用了一个组合框,在行源中放入一个范围,然后设置绑定列以匹配客户端 ID。但您仍然必须选择正确的客户端 ID。
那么有没有一种方法可以在选择客户端名称时简单地将客户端 ID 过滤器放入框中?我没有在这个 b/c 上显示代码,我真的不知道从哪里开始,而且我绝对不是 VB 大师
,一如既往......非常感谢!
got another question. I have a few forms set up for my client and some of the data is needed on more than one form. The user will input a client name and client id on the client tab. When they open a new form to enter financial info I have a combobox with the newly created client names and would love to have the client id automatically show up based on the client name. I have used a combobox where i put in a range in the rowsource and then set the bound column to match the client id. But you still have to choose the correct client id.
So is there a way I can simply have the client id filter into the box upon selection of the client name? I am not showing code on this b/c I can't really figure where to start and I am def no VB master
As always...Thanks a ton!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够按照以下方式在没有 VB 代码的情况下完成此操作。在客户表上有两列并排。现在
,在下一张纸上,从“开发人员”选项卡中拖动一个组合框。插入表单控件组合框,不要选择 ActiveX 组合框。右键单击组合框。选择格式控制。进入控制选项卡。对于输入范围,选择客户表上的 2 列范围(即从 IBM 到 3)。对于单元格链接,选择一个结果单元格。
现在,您的 ComboBox 应该列出 IBM、HP、Microsoft。当您选择一个项目时,单元链接应显示相应的客户端 ID。
You should be able to do this without VB code in the following way. On the client sheet have two columns side by side. Looking like
Now, on the next sheet, drag a combobox from the Developer tab. Insert a Form Control ComboBox, do not pick an ActiveX ComboBox. Right click on the ComboBox. Select Format Control. Got to the Control Tab. For Input Range, select the 2 column range on the Client Sheet (i.e. from IBM to 3). For Cell Link, select a result cell.
Now, your ComboBox should list IBM, HP, Microsoft. When you select an item the Cell Link should display the corresponding Client ID.