访问Webb应用程序 - 数据宏以从prev记录中提取值 [英] Access Webb App - Data Macro to pull value from prev record

查看:86
本文介绍了访问Webb应用程序 - 数据宏以从prev记录中提取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


希望有人可以提供协助。 


我正在创建一个跟踪我们的Access Web App商业银行账户。我遇到问题的一个功能是计算每日赚取的每日利息。我能够添加表达式来计算利息,但因为我需要
来计算每日利息,我会需要数据宏来从前一记录中提取最终余额并将其附加到当前记录中等等。  


以下是我的设置:


表名:INT_Roots


ID:自动编号


InTDate:计算日期利息


调整:将影响日均衡的账户上的任何借方或贷方


IntRate:利率。我们的每日利率为0.007(货币)


金额:前一天的余额(货币)


余额:日终余额(货币)


利息:当天赚取的利息(货币)


Adj_Desc:调整说明(这是一个评论字段) 


----


然后我创建了一个数据宏,在我的数据表Int_Roots上运行。 


注意:


1。当我创建一个表格时,我预先填写日期字段+365天,从创建记录的资金那天开始,这就是为什么我使用"每个记录"的原因。数据宏


2。第一个条目将具有初始资金数额的余额。  因此,利息计算应始终在第二条记录中开始。 


3。宏需要从前一天的余额中拉出并将其输入到金额字段中以计算利息。我尝试使用选择功能,但不要认为我正在使用该功能。 


4。我被困在第3步,但我还需要3个步骤来完成这个系统。我知道我可以制作这种混合版本并在excel或访问桌面上进行计算,但我尽可能地包含所有内容(适用于最终用户)。


(对不起我必须输入,因为他们仍在验证我的帐户)


组:  CalcINT


For EachRecord In:INT_Roots


条件: 



编辑记录:


SetField:


名称:INT_Roots.Amount


SetField:??????我需要一个表达式来拉动(从前一个记录的余额)+(调整)


名称:INT_Roots.Interest


值:=圆形([INT_Roots]。[Amount] * [INT_Roots]。[IntRate] / 365,2)


SetField:


名称:INT_Roots.Balance


值:= Round([INT_Roots]。[Amount] + [INT_Roots]。[Interest],2)




解决方案

我能够做到这一点。 


我有什么要做的是创建一个临时表来存储余额值,然后通过在INT_Roots余额中创建一个新条目,通过在新条目中设置从前一个余额中提取的值的值来追加。这是
我是怎么做到的。 


在INT_Roots表上我创建了一个On Insert宏 - >在我的临时表中创建一条记录(INT_Roots.Balance附加到Temp.Amount)。和


然后从


临时表我创建了一个插入 - >在INT_Roots中创建记录,其中新记录中的金额将是Temp.Amount的值。 


删除记录,以便我的临时表始终返回到无记录。 


我想让这个线程保持打开状态。如果其他人有更好的方法。  


Hello,

Was hoping someone can assist. 

I am creating an Access Web App that keeps track of our business bank accounts. one of the features that i am having a problem with is calculating daily interest earned per day. i am able to add the expressions to calculate the interest but because i need to calculate the interest daily, i would  need the data macro to pull the end balance from the previous record and append it in the current day record and so forth.  

Here is my set up:

Table Name: INT_Roots

ID: Auto Number

InTDate: Date interest is calculated

Adjustment: any Debit or Credits  on the account that will impact the day balance

IntRate: Rate of Interest. our interestdaily rate is 0.007 (Currency)

Amount: Balance of previous day (Currency)

Balance: end of day balance (Currency)

Interest: Interest earned on current day (Currency)

Adj_Desc: description of adjustment (this is a comment field) 

----

i then created a data macro to run on my datasheet Int_Roots. 

Notes:

1. When i create a table i pre populate the date field +365 days from the day of funding which creates a record and that is why i use a "for each record" data macro

2. the first entry will have a balance of the initial funding amount.  so, the interest calculation should always begin in the second record. 

3. the macro needs to pull from the previous day balance and enter it into the Amount field to calculate the interest. i tried using the Choose function but dont think i am using the functionality properly. 

4. i am stuck on step 3 but i will need 3 more steps to have this system complete. i know i can make this hybrid and do the calculations either on excel or on access desktop but as much as possible i wnat to contain everything in place (for end user).

(Sorry i have to type this out as they are still verifying my account)

Group:  CalcINT

For EachRecord In: INT_Roots

Where Condition: 

Edit Record:

SetField:

Name: INT_Roots.Amount

SetField: ?????? i need the expression that will pull the (balance from the previous record)+ (Adjustment)

Name: INT_Roots.Interest

Value: = Round([INT_Roots].[Amount]*[INT_Roots].[IntRate]/365,2)

SetField:

Name: INT_Roots.Balance

Value: =Round([INT_Roots].[Amount]+[INT_Roots].[Interest],2)


解决方案

I was able to accomplish this. 

what i had to do was  create a temp table to store the balance value and from there append by creating a new entry in the INT_Roots balance by setting the field in the new entry with the value of what was pulled from the previous balance. here is how i did it. 

on the INT_Roots table i created an Upon Insert macro --> create a record in my temp table (INT_Roots.Balance appends to Temp.Amount). and

then from

the Temp Table i created an upon insert --> create record in INT_Roots, where the amount inthe  new record will be the value of Temp.Amount. 

The, Delete Record so that my temp table always goes back to no records. 

i want  to keep this thread open though. in case anyone else has a better method.  


这篇关于访问Webb应用程序 - 数据宏以从prev记录中提取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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