Access 2007运行减法?

发布于 2024-11-03 12:11:26 字数 68 浏览 0 评论 0原文

我知道 access 有一个正在运行的附加功能。但我怎样才能对报告进行连续减法呢?我已经用尽了所有的出路,但我无法弄清楚。

I know access has a running addition. but how can i possibly do a running subtraction on a report? I've exhausted all my outlets and I cannot figure it out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

韬韬不绝 2024-11-10 12:11:26

您需要有几个隐藏的控件。

首先,在报告的标题中,使用 DSum() 获取所有记录的总计。这将是一个带有 ControlSource 的控件,如下所示:

  =DSum("Price","tblInventory")

您可能需要为此提供第三个参数,这将是一个 WHERE 子句(不带 WHERE)。

控件的名称类似于 txtTotal

现在,在报告的详细信息上放置两个未绑定的控件。将第一个 ControlSource 设为要总计的字段,并适当设置其 Running Sum 属性(Over All 或 Over Group,具体取决于报表的设置方式)。将此控件命名为类似于 txtRunningSum 的名称,并将其 .Visible 属性设置为 FALSE。

现在,在最后一个控件中,分配此 ControlSource:

  =[txtTotal]-[txtRunningSum]

这应该可以解决问题 - 您将拥有一个控件,可以从总和中减去运行总和,并给出递减的运行总和。

You'll need to have several hidden controls.

First, in the report's header, use a DSum() to get the total of all your records. That would be a control with a ControlSource something like this:

  =DSum("Price","tblInventory")

You may want to provide the third argument for that, which would be a WHERE clause (without the WHERE).

Name that control something like txtTotal.

Now, drop two unbound controls on the detail of your report. Make the first one's ControlSource the field you're totalling and set its Running Sum property appropriately (Over All or Over Group, depending on how your report is set up). Name this control something like txtRunningSum, and set its .Visible property to FALSE.

Now, in the last control, assign this ControlSource:

  =[txtTotal]-[txtRunningSum]

That should do the trick -- you'll have a control that subtracts the running sum from the overal total and gives you a descending running sum.

温柔女人霸气范 2024-11-10 12:11:26

作为替代方案,考虑简单地将您的值乘以 -1 并继续使用正常的运行总和方法...

As an alternative, consider simply multiplying your value by -1 and continue to use normal running sum methods...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文