自动填充多个组合/列表框 [英] Auto filling multiple combo/list boxes

查看:84
本文介绍了自动填充多个组合/列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个涉及组合框的新问题。好吧,现在我想尽力解释这个,我希望(NeoPa)没有注意到我是否搞砸了:D


这将与我的关系相提并论上次使用组合框并尝试进行自动填充和更新。


我想做的就是这样我可以将信息输入到一个组合框中,例如一个ID号,它会在桌面上查找并拉出其余的信息与该ID号相关联并自动填写具有正确信息的其他组合框。


例如(在我的表格上),我有一个标有公司ID的盒子,然后我还有另一组盒子,公司位置分成3个盒子,有城市,州和邮政编码。我想要的是,如果我输入公司ID,它将在我的桌子上引用ID号,然后用匹配的City,State和Zip填写其他方框。


我希望这很清楚。

I have a new problem that I am playing with involving the combo boxes. Alright now im going to try to explain this as best I can and hope (NeoPa) doesnt notice if I mess up :D

This is going to be a tie in to what I was doing last time with the combo boxes and trying to make the auto-fill and update.

What im trying to do is make it so I can type information in to one Combo Box such as an ID number and it will look up on the table and pull the rest of the information associated with that ID number and auto fill in other combo boxes with the right information.

So for example (on my form), I have a box labeled Company ID, Then I also have another set of boxes with company location broken in to 3 boxes that have city, state, and zip code. What I want is if I type in the Company ID it will reference that with an ID number on my table and then fill in the other boxes with the matching City, State, and Zip.

Im hoping this is clear enough.

推荐答案

你是否尝试过在OnChange()事件中使用DLookup你打字的盒子?然后将返回的值插入到ComboBox中?
have you tried using a DLookup in the OnChange() event of the box your typing into? Then inserting the returned value into your ComboBoxes?


我不确定是否应该使用DLookUp函数或代码来执行级联组合/列表框?


我还读了更多DLookUp函数。我会把这个功能放在每个方框中,还是只有ID号框,它会知道填写其他方块吗?
I wasnt sure if I should go with the DLookUp function or a code for doing a cascading combo/list box??

Also I read over the DLookUp function more. Would I put that function in each box or only the ID number box and it will know to fill in the other boxes?


你需要把它放在OnChange()事件中用户输入ID号的框。您在该事件中编写的代码将处理将项添加到组合框中。 (我假设您熟悉在事件过程中编写VBA代码)
you will need to put it in the OnChange() event of the box where your users are inputting the ID number. The code you write in that event will handle adding the items into the combo boxes. (I''m assuming you are familiar with writing VBA code in event procedures)


这篇关于自动填充多个组合/列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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