组合框选择在另一个组合框中生成变量 [英] Combo box selection generates variables in another combo box

查看:108
本文介绍了组合框选择在另一个组合框中生成变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

处理电动橡胶手套.....


tblCOMMODITY包含字段CLASS,SIZE和& COMMODITY_NUM(PK)。结合大小的类别构成商品编号。我不希望用户按商品编号选择手套,因为它们是7位数字,没有字面意义。数据库用户将通过两个组合框选择客户需求,首先是按类,然后按大小。


问题1.第3类只有4种尺寸可供选择。 2级有8种尺寸可供选择。我真的喜欢让我的第二个组合框值取决于第一个组合框中选择的内容,这样他们就不会制作那些不可用的组合。我该怎么做?最近的一篇帖子提出了类似的问题:(21.7 KB,190 views)


TheSmileyOne和ADezii,

非常感谢您的回复!当我读到Smiley的回复时,我知道我还没有走出困境,因为我还不知道Combobox的查询是什么。但是我想通过一些研究我可以更接近我的答案。 ADezii,你总是为我做额外的一步,我感到非常不配。你们这些人很好,只是当我认为我的软件写作是一个失败的原因时,有人会提升并让我继续前进。我不能说你的支持和鼓励(以及专业知识!)。 :-)我将在下周离开工作,所以直到那时我才能完成所有这些工作并报告我的成功!非常感谢,直到那时....

Danica


PS。 ADezii,你的程序正好展示了我的目标。我会彻底调查它并回复另一篇文章,这样我就可以帮助别人尝试做类似的事情。 ; - )

Dealing with electric utility rubber gloves.....

tblCOMMODITY contains fields CLASS, SIZE, & COMMODITY_NUM (PK). A class combined with a size make a commodity number. I don''t want the user selecting gloves by commodity number because they are 7 digit numbers that make no literal sense. DB users will select what a customer needs by two combo boxes, first by class, then by size.

Question 1. Class 3 only has 4 sizes available. Class 2 has 8 sizes available. I''d really like to have my second combo box values be dependent on what is selected in the first combo box, so that they don''t make combinations that aren''t available. How do I do it? A recent post posed a similar question: http://bytes.com/topic/visual-basic-...-box-selection but the link provided was more than I could comprehend. Can anyone offer another approach?

Question 2. When the two combo box selections are made, I''d like to automatically pull in the COMMODITY_NUM, which is the PK. Can I handle that with dlookup or something similar?

Thanks so much!

解决方案

You add an AfterUpdate event handler to the first combobox,

Expand|Select|Wrap|Line Numbers


Hello Danica. I''ve created a Simple Demo that should point you in the right direction, just Download it.

Attached Files
DanicaDear.zip (21.7 KB, 190 views)


TheSmileyOne and ADezii,
Thank you SO MUCH for your replies! When I read Smiley''s reply I knew I was still not out of the woods because I don''t yet know what a Combobox query is. However I figured with some research I could get closer to my answer. ADezii, you always go the extra step for me and I feel so undeserving. You people are SO NICE and just when I think my software writing is a lost cause someone steps up and keeps me rolling. I cannot say enough nice words for your support and encouragement (and expertise!). :-) I will be away from work for the next week so it will be until then that I get all this worked out and report my success! Thanks so much until then....
Danica

PS. ADezii, your program demonstrates exactly what I was trying to do. I will investigate it thoroughly and also reply to another post so I can help out someone else trying to do something similar. ;-)


这篇关于组合框选择在另一个组合框中生成变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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