显示记录中的差异 - MS Access 2007
我有一个具有以下布局的子表单:
ID---Count---Difference---Weight---Difference
填充数据如下所示:
ID---Count---Difference---Weight---Difference
1----5--------------------8.3----------------
2----9--------------------12.3---------------
3----16-------------------17.8---------------
如何区分记录值和之前的记录值?使用前面的示例,我希望“差异”控件如下所示:
ID---Count---Difference---Weight---Difference
1----5-------0------------8.3------0---------
2----9-------4------------12.4-----4.1-------
7----16------7------------17.8-----5.4-------
如您所见,由于记录 ID 1 是第一条记录,因此差异为 0;然而,ID 2 显示计数差异为 4 (9-5),重量差异为 4.1 (12.4 - 8.3);和 ID 7 显示计数差异为 7 (16-9),重量差异为 5.4 (17.8 - 12.4)。
另请注意,ID 号不一定会一一递增(可能存在间隙)。
我怎样才能达到预期的结果?表达方式?编程语言?
非常感谢任何帮助!
I have a subform with the following layout:
ID---Count---Difference---Weight---Difference
Populated with data looks like this:
ID---Count---Difference---Weight---Difference
1----5--------------------8.3----------------
2----9--------------------12.3---------------
3----16-------------------17.8---------------
How can I tell the difference between a record value and the one before it? Using the previous example, I'd like the Difference controls to look like so:
ID---Count---Difference---Weight---Difference
1----5-------0------------8.3------0---------
2----9-------4------------12.4-----4.1-------
7----16------7------------17.8-----5.4-------
As you can see, since record ID 1 is the first record, the difference is 0; however, ID 2 shows a Count Difference of 4 (9-5) and a Weight Difference of 4.1 (12.4 - 8.3); and ID 7
shows a Count Difference of 7 (16-9) and a Weight Difference of 5.4 (17.8 - 12.4).
Also note that the ID #'s do not necessarily increment one-by-one (there can be gaps).
How can I achieve the desired results? Expressions? VBA?
Any help with this is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论