帮助组合框确定第二个组合框的选择 [英] Help with combo box determining selections of second combo box

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

问题描述

大家好,


我在表单中有一个子表单,我有两个组合框。第一个组合是Facility,第二个组合是Unit。我希望Unit的选择由Facility中的选择决定。我使用下面的Row Source信息进行设置:


SELECT [tblUnitFloor] .Unit FROM tblUnitFloor WHERE((([tblUnitFloor] .Facility)= Forms!frmMainForm!sfrMainSub!Facility) );


tblUnitFloor是一张包含所有单位和设施的表格。


我的问题是,当我选择第一个设施时记录我看到工厂的所有适当单位。但是在下一个记录中,如果我选择不同的设施,我仍然会看到第一个设施的所有单位。有没有人有任何想法?

Hello all,

I have a subform within a form and I have two combo boxes. the first combo is Facility and the second is Unit. I want the selections for Unit to be determined by the selection in Facility. I have it setup with the folowing Row Source info:

SELECT [tblUnitFloor].Unit FROM tblUnitFloor WHERE ((([tblUnitFloor].Facility)=Forms!frmMainForm!sfrMainSub!Facility)) ;

tblUnitFloor is a table with all the Units and the Facilities listed.

My problem is this, when I select a Facility for the first record I see all the proper Units for the Facility. But in the next record, if I select a different Facility, I still see all the Units for the first Facility. Anyone have any thoughts?

推荐答案

查看级联组合/列表框。我认为它应该包含您需要的所有信息。
Check out this insight on Cascading Combo/List Boxes. I think it should have all the information you need.


谢谢!我会试一试!!!
Thanks! I will give it a try!!!


好吧,它几乎可以工作......


我在第一个组合框中做出选择,但是当我第二个盒子的下拉片碰撞时,会弹出一个窗口,我必须从第一个盒子中手动输入我想要的选项。之后,我确实看到第二个框的正确选项。


这是我使用的代码:
Well, it almost works...

I make a selection in the first combo box, but when I clink on the drop down for the second box, a window pops up and I have to manually type the option I want from the first box. After that, I do see the correct options for the second box.

Here is the code I used:
展开 | 选择 | Wrap < span class =codeDivider> | 行号


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

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