以连续形式求和 [英] Sum in a Continuous Form

查看:71
本文介绍了以连续形式求和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个我正在使用的表格,并且为了调整计算的能力,它投入了工作。


我试图以连续的形式对未绑定的控制计算求和。


问题:你能只计算一个绑定的控件名吗?这就是我收到错误的原因吗?


问题:我必须使用查询为我做计算吗?


如果是是的,我试图找到我想要做的事情的例子而且找不到任何东西 - 你能给我一些方向找到例子。


感谢您的帮助

gary

I made an addition to a form I was using and it threw a wrench into the works for my ability to adjust the calculation.

I am trying to sum a unbound control calculation in a continous form.

question: can you only sum a bound control name? is that why I am getting an error?

question: must I use a query to do the calculation for me?

if that is true i was trying to locate examples of what i am trying to do and can''t locate any - could you give me some direction where to find examples.

thanks for your help
gary

推荐答案

在对计算字段求和时,您必须使用表达式,而不是字段本身。换句话说,如果

FieldC = FieldA + FieldB


你不能使用

总和(FieldC)


你必须使用


总和(FieldA + FieldB)



Linq ; 0)>
When summing a calculated field you have to use the expression, not the field itself. In other words if

FieldC = FieldA + FieldB

you cannot use

Sum(FieldC)

you have to use

Sum(FieldA + FieldB)


Linq ;0)>


你可以更具体地了解一下你在尝试什么要做什么?


正确的方法将取决于你的领域在连续的形式(在同一记录或不同的记录中)


如果您需要在表单上的每个记录中对textbox1的值求和,则需要从第一个记录中获取值,前进到下一个记录,添加值,前进等等 - 并回显missinglinq是什么说你可能不得不参考计算而不是价值...


你可以提供一个例子和你的错误吗? :)
can u be a bit more specific as to what you''re trying to do?

the right approach will depend on where your fields are in the continuous form ( in the same record or in different records)

if you are needing to sum the value of textbox1 in each of the records on your form you will need to grab the value from the first record, advance to the next, add the value, advance etc. - and to echo what missinglinq is saying you''ll probably have to refer to the calculation as opposed to the value...

can u provide an example and your error? : )


@GLEberts


忘记汇总这些值。它们甚至是不同的总和值吗?


参见为什么我们认为它们都是相同的并且总结它们是浪费精力,为什么我们认为它们都是一样的。
@GLEberts
Forget summing these values. Are they even different values to sum?

See Why Values in Unbound Form Controls Don''t Persist for why I think they will all be the same and summing them a waste of effort.


这篇关于以连续形式求和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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