简体   繁体   English

Microsoft Access SQL玩杂耍

[英]Microsoft Access sql juggling

The end-user chooses something from a drop-down (it shows description text related to unique ID, but doesn't show the ID) 最终用户从下拉菜单中选择某项(它显示与唯一ID相关的描述文字,但不显示ID)

How would I go about making a further query that uses the user input ID as a parameter for further manipulation? 我将如何进行进一步查询,以用户输入的ID作为进一步操作的参数?

select x,y 
from table1 
where k in {1,2,23}

Let's say the user selects 23 假设用户选择了23

select j,l
from table2
where k=23 and {other conditions}

Search for access cascading combobox (at least I think this is what you are looking for). 搜索访问级联组合框(至少我认为这是您想要的)。 – Andre 20 hours ago –安德烈20小时前

thanks for the tip @Andre that actually solved half of the question. 感谢@Andre的提示,它实际上解决了一半的问题。 The other half remains Can this be done WITHOUT forms, where one table.column.value is used as the condition or not? 剩下的另一半可以不使用表格(以一个table.column.value作为条件)来完成吗? I possibly blew this out of proportion, but it will be a useful time-saver for any successive projects with Access... – Nikola Pavlovic 我可能夸大了这一点,但是对于使用Access的任何后续项目,这将是一个有用的节省时间的方法– – Nikola Pavlovic

Cascading combobox requires code to requery combobox. 级联组合框需要代码来重新查询组合框。 Cannot be done in table or query. 无法在表或查询中完成。 But if you do not want cascading combobox, but progressive filtering of table or query, also not pracitcal with VBA. 但是,如果您不希望级联组合框,而希望对表或查询进行渐进式过滤,那么也不希望使用VBA。 – June7 11 hours ago – June7 11小时前

Alright so the answer to my question is: I can't have what I want without forms, and when I accept having to have forms, the solution is called Cascading combobox Thanks for all your support, people!!! 好的,所以我的问题的答案是:没有表单,我将无法拥有我想要的东西;当我接受必须拥有表单时,该解决方案称为Cascading combobox。感谢大家的支持,人们!!! – Nikola Pavlovic 39 mins ago –尼古拉·帕夫洛维奇39分钟前

The issue is resolved. 问题已解决。 Thanks again to everyone!!! 再次感谢大家!!!

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

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