我有一个名为“Search”的表单,其中涉及Transaction Search下的部分。它根据从名为“个人”的表中抽取的全名(Combo40)和委员会在Combo40中选择的用户在委员会字段中贡献的委员会调用查询:msaccess sql查询协助
委员会查询:
SELECT Transactions.[Committee Name] FROM Transactions GROUP BY Transactions.[Committee Name], Transactions.[Employee Name] HAVING (((Transactions.[Employee Name])=[Forms]![Search]![Combo40]));
我试图添加一个额外的参数,该参数还比较了个人给出的年份,该年份是Combo46交易表中的一个特定字段。
新查询:
SELECT Transactions.[Committee Name] FROM Transactions GROUP BY Transactions. [Committee Name], Transactions.[Employee Name] HAVING (((Transactions.[Employee Name])=Forms!Search!Combo40) And (((Transactions.Combo46)=Forms!Search!Combo51)))
Forms!Search!Combo40 = pulls the values from a table called “Individuals”
Transactions.Combo46 = year (i.e. 2011, 2012, 2013 etc.)
Forms!Search!Combo51 = year (i.e. 2011, 2012, 2013 etc.)
当我做的形式,我得到的是要求我对组合46和委员会名单输入值的窗口上我的选择显示为个人和所有记录不只是交易与我进入的那一年。我预计它根本不会弹出一个弹出窗口,而是从事务表中的Combo46中取值,并将其与Combo51中输入的值进行比较。