简体   繁体   English

查询-组合框-条件选择-MS Access

[英]Query - ComboBox - criteria select - MS Access

I have the following data (examples): 我有以下数据(示例):

tblModel
Mod_ID  Mod_Num  Mod_Desc
1       0001     Model01
2       0002     Model02

tblArticle
Art_ID  Art_Num  Art_Desc
1       001      Article X
2       002      Article Y
3       003      Article Z
4       004      Article K

tblOperation
Op_ID  Op_Num  Op_Desc
1      01      Gluing
2      02      Sewing
3      03      Stitching

tblMaterial
Mat_ID  Mat_Num  Mat_Desc
1       B001     Blue
2       R001     Red 
3       K001     Black

And the data structure is as follows: 数据结构如下:

tblModelArticle
MA_ID  Mod_ID  Art_ID  MA_Description
1      1       1       Model01 - Article X
2      1       2       Model01 - Article Y
3      2       3       Model02 - Article Z
4      2       4       Model02 - Article K

tblModelOperation
MO_ID  Mod_ID  Op_ID  MO_Description
1      1       1      Model01 - Op Gluing
2      1       2      Model01 - Op Sewing
3      1       3      Model01 - Op Stitching
4      2       1      Model02 - Op Gluing
5      2       3      Model02 - Op Stitching

tblArticleOperationMaterial
AOM_ID  MA_ID  MO_ID  Mat_ID  AOM_Description
1       1      3      1       Model01 - Article X - Operation Stitching - Material Blue
2       2      3      2       Model01 - Article Y - Operation Stitching - Material Red
3       3      5      2       Model02 - Article Z - Operation Stitching - Material Red
4       4      5      3       Model02 - Article K - Operation Stitching - Material Black   

My question is: How do I make a ComboBox dropdown in tblArticleOperationMaterial limited? 我的问题是:如何在tblArticleOperationMaterial limited中制作ComboBox下拉菜单? That is, once I for example select "MA_ID" to be 1, I want to be able to select only the 1, 2, 3 as MO_ID. 也就是说,例如,一旦我将“ MA_ID”选择为1,我希望能够仅选择1、2、3作为MO_ID。 For instance if "MA_ID" 2 value was input, the MO_ID dropbox combox box would offer only options of 4 and 5 to be selected as MO_ID. 例如,如果输入了“ MA_ID” 2值,则MO_ID下拉框组合框将仅提供4和5的选项作为MO_ID。

its called cascading action. 这就是所谓的级联动作。 search for cascading combobox or check this : MS Access Forms : How to dynamically change the select options in a combo box? 搜索级联组合框或选中此框: MS Access Forms:如何动态更改组合框中的选择选项?

or similar question: Get ID Filed from a Combobox in a Text Box where 1st column set to 0 或类似的问题: 从文本框的组合框中获取ID,其中第一列设置为0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM