SubForm字段总计的#Error。 [英] #Error on SubForm field totalling.

查看:47
本文介绍了SubForm字段总计的#Error。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我很难受,不得不放弃并寻求帮助,但即使是由我的生物学限制的无所不知的谷歌也不能解决这个问题,我还在学习Access,所以这里有。


我有一个包含子表单的主表单,它列出了一个订单中的产品,其页脚是一个名为 sfrmTotal 的文本框,其控制源包含表达式:

=总和(Nz([SubTotal],0))


回到主窗体我有一个带控制源的文本框:

= [sfrmcOrderDetails]。[Form]![sfrmTotal]


子窗体还包含折扣,税,数量等字段我已经在所有字段上尝试了上面的Sum()表达式,并且每个字段都返回子窗体控件和主窗体上的#Error。


[Total]和[SubTotal]是计算查询字段,但[Quantity]和[Discount]不是。这应该是有区别的吗?


我尝试过一个名为nnz(非数字零)的函数,这没什么区别。


我正在调整查询,检查名称并弄乱昨天最好的部分。我在路上学到了很多东西,但是我并没有找到导致所有领域出现#Error的原因。


我的最后一招是向Bytes.com的大师们寻求神圣的帮助,或者至少引导我朝着正确的方向寻找解决方案来消除#我项目的错误。


提前致谢。


Jay

Hi all,

I''m stumped and it hurts to have to give up and ask for help, but even the omniscient Google limited by my mere biology can''t solve this, and I''m still learning Access so here goes.

I have a main form containing a subform, which lists products within an order, in the footer of which is a text box called sfrmTotal whose control source contains the expression:
=Sum(Nz([SubTotal],0))

Back on the main form I have a text box with control source:
=[sfrmcOrderDetails].[Form]![sfrmTotal]

The subform also contains fields such as Discount, Tax, Quantity, etc. I have tried the above Sum() expression on all of the fields and every single one of them returns #Error on both the subform control and the main form one.

[Total] and [SubTotal] are calculated query fields, but [Quantity] and [Discount] are not. Should that even make a difference?

I have tried a function called nnz (not numeric zero), which makes no difference.

I was tweaking queries, checking names and messing with things for the best part of yesterday. I''ve learned a lot on the way, but I''m no closer to figuring out what is causing the #Error on ALL of the fields.

My last resort is to appeal to the Gurus of Bytes.com for divine assistance or at least guide me in the right direction of where I should be looking for a solution to banish the #Errors from my project.


Thanks in advance.

Jay

推荐答案

我认为问题是你试图总结一个计算字段。您需要在Sum()函数中包含整个Expression,类似于:
I think the problem is that you are trying to Summarize a Calculated Field. You would need to include the entire Expression within the Sum() Function, something similar to:
展开 | 选择 | Wrap < span class =codeDivider> | 行号


感谢您的快速回复ADezii,但是当试图求和[数量],[单位成本]或类似的非计算字段时,表达式甚至不起作用,例如:


=总和(Nz( [数量],0))
Thanks for your speedy reply ADezii, but the expression won''t even work when trying to sum [Quantity], [Unit Cost] or similar non-calculated fields, e.g.:

=Sum(Nz([Quantity],0))


如果它是相关的,这里是SubForm的基础查询的SQL:

In case it is pertinent, here is the SQL for the SubForm''s underlying query:

展开 | 选择 | Wrap | 行号


这篇关于SubForm字段总计的#Error。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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