如何自动将VALUE保存到表字段中? [英] How to automatically save a VALUE into a table field?

查看:61
本文介绍了如何自动将VALUE保存到表字段中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在开发一个On Leave应用程序。其中试图计算员工休假天数。


我创建了一个表格,包含这些字段(从表格中):


( 1)。 OnLeaveID(用于关系 - 自动)

(2)。 StartDate(休假日期开始 - 短日期)

(3)。 EndDate(休假的最后日期 - 短日期)

(4)。 NumPublicDay(公众假期数)

(5)。 CalcDaysOnLeave(计算休假天数)

(6)。 DaysOnleave(此字段用于保存结果/值编号(5)作为其字段数据)

(7)。 BFOnLeave(从去年开始的天数)

(8)。 EligOnLeave(有资格获得该特定年份的天数)

(9)。 AvaiOnLeave(休假时可用余额)


这个想法是这样的(我想要的,所有必须以相同的形式自动计算):

i。(2),(3),(4),(7),(8)<<<手动数据输入

ii。(5)=(3) - (2) - (4)<<<返回一个值,但我希望将此结果保存在字段(6)中以供下次引用;我把这样的东西放在CalcDaysOnLeave的控制源中:

= [EndDate] - [StartDate] - [NumPublicDay]

iii。然后我想使用(6)数据进行第二次计算:

(9)=(7)+(8) - (6)


我想我没有遇到任何其他问题,除了如何将值(6)保存到表格中的字段数据中。


你能帮助我吗?这个?我非常感谢你的解决方案。谢谢。

Hi

I am developing an On Leave app. in which trying to calculate employees days on leave.

I have created a Form consists of this fields (from a table):

(1). OnLeaveID (used as for the Relationship - Auto)
(2). StartDate (the starting on leave date - short date)
(3). EndDate (the last date on leave - short date)
(4). NumPublicDay (the number of public holidays)
(5). CalcDaysOnLeave (calculate days on leave applied)
(6). DaysOnleave (this field is used to save result/value no. (5) as its field data)
(7). BFOnLeave (no. of days brought forward from last year)
(8). EligOnLeave (no. of days eligible for that particular year)
(9). AvaiOnLeave (balance on leave available)

The idea is like this (as what I want, all must be auto-calc. in same single form):

i.(2),(3),(4),(7),(8) <<< manual data entry
ii.(5) = (3) - (2) - (4) <<< returns a value but I want this result to be kept in field (6) for next reference; report etc. I put something like this in the CalcDaysOnLeave''s Control Source :
= [EndDate]-[StartDate]-[NumPublicDay]
iii. Then I want to use the (6) data for my 2nd calculation :
(9) = (7) + (8) - (6)

I think I didn''t face any problem with the rest, except on how to keep a value (6) into the field data in the table.

Could you please assist me on this? I am really grateful with your solution. Thanks.

推荐答案

永远不能将可计算字段存储在规范化数据库中。请参阅数据库规范化和表格结构


好​​像你需要一个根本的反思我很害怕。
Calculable fields should never be stored in a Normalised database. See Database Normalisation and Table Structures.

It seems like you need a fundamental rethink I''m afraid.


感谢您的回复。


我知道Normalization方法,但是我需要将值(5)保存在字段(6)中,这样我总是可以将它引用到下一次计算,报告视图等。


在这种情况下,有没有更好的解决方案让我遵循似乎我想要的就是在用户输入数据(7),(8),(2),(3)和(4)之后,结果(5)将自动生成。然后是结果(9)。


谢谢。
Thanks for your respond.

I''m aware of the Normalisation method, however I need to have the value (5) kept in a field (6) so that I can always refer it for next calculation, report views etc.

In that case, is there any better solution for me to follow seems what I want is that just right after the user entered data (7), (8),(2), (3) and (4), result (5) will automatically generated. Then comes result (9).

Thanks.


这是简单的替换。
( 9)=(7)+(8) - ((3) - (2) - (4))


这篇关于如何自动将VALUE保存到表字段中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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