根据计算更新字段 [英] Update fields based on calculation

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

问题描述

我是使用VBA代码编程的新手。我参与开发数据库。我创建了大部分表和查询。现在我处于执行某些计算的复杂部分,所以我决定使用VBA代码。这就是我所拥有的。



我有两张桌子Tbl1和Tbl2。

Tbl 1有以下字段

账户余额设定日期


Tbl2有以下字段,

账户sumofbalance设置Bal Overstated Balance


从夸大的余额中扣除相同的账户号码,从最近的日期开始,以获得新的平衡。对于从最近一天开始直到夸大的余额用尽的同一帐户中的所有余额应该这样做。


例如

如果夸大金额是200,从最近的余额中扣除100以使其为零。剩余的100个夸大的余额将从下一个最近的余额中扣除,依此类推,直到夸大的余额用完为止。

I am new to programming using VBA code. I am involved in developing a database. I created most of the tables and queries. Now I am at the complicated part of implementing some calculations, so I decided to use VBA code. This is what I have.


I have two tables Tbl1 and Tbl2.
Tbl 1 has the following fields
Account Balance Set Date

Tbl2 has the following fields,
Account sumofbalance Set Bal Overstated Balance


IThe overstated balance is to be deducted from the balance field having the same account numbers starting with the most recent date to attain the new balance. This should be done for all the balances in the same account starting from the most recent date until the overstated balance gets exhausted.

Eg
If the overstated amount is 200, the 100 is deducted from the most recent balance to make it zero. The remaining 100 of the overstated balance is deducted from the next recent balance and so on till the overstated balance gets exhausted.

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

推荐答案

如果您可以按照我在示例中使用的相同方式发布表的元数据(有关布局/结构的信息),这将更好。单击回复按钮,您将可以访问我使用过的所有代码。 PK& FK代表Primary Key&外键分别为。
表名= [ tblStudent ]
This will work much better if you can post the meta-data (info about the layout / structure) of the table in the same way as I use in my example. Click on the Reply button and you will have access to all the codes I''ve used. PK & FK stand for Primary Key & Foreign Key respectively.
Table Name=[tblStudent]
展开 | 选择 | 换行 | 行号


感谢您的帮助,我很感激。

表名= [ tblColl ]
Thanks for your help, I appreciate that.

Table Name=[tblColl]
展开 | 选择 | Wrap | 行号


我会看看我是否可以找一些时间来看一下这个。我已经花了很多时间重新格式化你的帖子,以便更清楚地阅读(非常难以开始,否则)我已经做空了。


我当时希望你能做到这一点,但我很感激,至少你已经付出了一些努力来试图详细解释这种情况。如果它不简单,那就是问题而不是解释。
I will see if I can find some time to look at this later. I''ve taken up so much time reformatting your post such that it''s clearer to read (very hard to even start on otherwise) that I''ve run short.

I was rather hoping you''d do this bit, but I appreciate that at least you''ve shown some effort to try to explain the situation in great detail anyway. If it''s not simple, that''s down to the problem rather than the explanation.


这篇关于根据计算更新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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