使用组合框进行SUM查询 [英] SUM query using a combo box
问题描述
继承人我所拥有的:
我设置了3个相同的表。唯一的区别是表格有不同的标题,因为它们是不同客户的数据库。
该表格包含以下字段:
" RMA#" ;,Quote ID,Credit(USD),Credit(#),Credit(Euros),Credit(CAD)和Credit(YEN) )
我有一个名为form1的表单,它有:
一个组合框(combo23)设置三个客户表的名称。
我想要什么:
我想知道是否有办法可以从组合框中选择客户表的名称,并使用命令按钮查询以下字段Credit(USD),Credit(#),Credit(Euros), Credit(CAD)和Credit(YEN)。我希望此查询绑定到命令按钮。
这可能吗?
Heres what i have:
i have 3 tables set up that are identical. The only difference is that the tables have different titles as they are databases for different customers.
The table has the following fields:
"RMA #", "Quote ID", "Credit(USD)", "Credit(#)", "Credit(Euros)", "Credit(CAD)", and "Credit(YEN)"
I have a form called form1 that has:
A combo box (combo23) set up with the name of the three customer tables.
WHAT I WANT:
I was wondering if there was a way to be able to select the name of the customer table from the combo box,and have a command button query sum the following fields "Credit(USD)", "Credit(#)", "Credit(Euros)", "Credit(CAD)", and "Credit(YEN)". I would like this query to be tied to a command button.
Is this possible?
推荐答案
嗨肯特
好吧我想你想要的是设置一个动态查询。我已经留下空间让你把你想要做的查询结果放进去了,就像你没说的那样。
Hi Kent
OK I think what you want is to set up a dynamic query. I''ve left space for you to put in what you want to do with the query results as you didn''t say.
MMcCarthy,
再次感谢您的帮助。对不起,我忘了告诉你我希望结果在哪里。我希望将结果更新到我刚刚创建的表中。该表的标题为客户表。具有以下字段:
Customer,Customer ID,Credit(USD),Credit(#),Credit(Euros)和Credit(USD)。 ,Credit(CAD)和Credit(YEN)
我在客户字段中拥有所有客户名称,所以当有总和查询运行它只更新正确的客户行(从之前的combo23中选择)和正确的字段(Credit(USD),Credit(#),Credit(Euros)," Credit(CAD)"和Credit(YEN))
总和查询的代码和更新customer table的查询的代码是什么。我想把它链接到一个命令按钮。
提前谢谢
MMcCarthy,
Once again thanks for the help. Sorry i forgot to tell you where i wanted the results to go. I would like the results to be updated into a table that i just created. The table is titled "Customer Table" with the following fields:
"Customer", "Customer ID", "Credit(USD)", "Credit(#)", "Credit(Euros)", "Credit(CAD)", and "Credit(YEN)"
I have all of the customers names in the customer field so is there a way that when the sum query runs it only updates the correct customer row (chosen from combo23 like before) and correct fields ("Credit(USD)", "Credit(#)", "Credit(Euros)", "Credit(CAD)", and "Credit(YEN)")
What would be the code for the sum query and the query that updates the "customer table". I would like to link it to a command button.
Thanks in advance
好的,试试这个...
>
OK try this ...
这篇关于使用组合框进行SUM查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!