列表框选择产品并计算查询中的总和 [英] listbox to select products and calculate the sum in query

查看:86
本文介绍了列表框选择产品并计算查询中的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两个列表框用于查看产品表中的所有产品

第二个用于从第一个产品中选择特定产品

我可以使用查询获得所选产品列表框中所有产品的总和

非常感谢

解决方案

你可以循环遍历列表框中选择的所有项目,制作过滤字符串,然后将其与DSUM一起使用,以获得所需的结果。至少,这是我会使用的方法。


如果你需要代码样本,请告诉我。


如果第二个有一个过滤器反映了您的表单中包含哪些记录,然后您可以在SQL中使用该过滤器计算总和(无论您想要求和的总和)。


@TheSmileyOne




谢谢

第二个列表框中的选定项目

我如果我限制两个日期之间的生产期限,则无法计算查询中此项目的数量总和

请提供代码示例

我非常感谢您的支持帮助

hi,
I have two listboxes on for viewing all the products from products table
the second one to select specific products from the first one
can I get the sum using query for all the products in the selected products listbox
thank you very much

解决方案

You could loop through all the items selected in your listbox, making a filter string, then using that along with DSUM, to give you the desired result. Atleast, that is the approach I would use.

If you need code samples let me know.


If the second one has a filter that reflects which records are included in your form, then you could use that filter in your SQL to work out the sum (of whatever you want to sum).


@TheSmileyOne
hi,
thank you
the selected items in the second listbox
I cannot calculate the sum of quantity of this items within query specifically if I limited the period of the production between two dates
please provide me with the code sample
I really appreciate your help


这篇关于列表框选择产品并计算查询中的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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