如何在编辑表单上的字段时向表单添加日期? [英] How do I add a date to a form when a field on the form has been edited?

查看:104
本文介绍了如何在编辑表单上的字段时向表单添加日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个控件的表单。我希望能够在上次更新记录时进行任何更改时将日期自动记录在表单上。有没有办法做到这一点?

I have a form with multiple controls on it. I would like to be able to have the date automatically recorded on the form when any changes have been made to show when the record was last updated. Is there a way to do this?

推荐答案

是的,在AfterUpdate上写代码您想要跟踪的每个控件,一旦它被更新,它会将Last Updated字段更新为Now()。


ie
Yes, write code on the "AfterUpdate" of each control you want to track, so that once it is updated it will update the Last Updated field to Now().

i.e.
展开 < span class =codeDivider> | 选择 | Wrap | Line数字


我在这里看不到要求每个控件都有一个单独的更新字段。要在记录中编辑任何控件时加上时间戳,只需将代码放在 Form_BeforeUpdate 事件中:

I see nothing here demanding that there be a separate updated field for each control. To timestamp when any control is edited in the record, simply place the code in the Form_BeforeUpdate event:

展开 | 选择 | Wrap | 行号


Missinglinq,

我尝试了你的代码,但它没有用。我有一个名为Last_Updated_Date的文本框,我想在日期显示。我错过了什么吗?
Missinglinq,
I tried your code but it''s not working. I have a text box that is called Last_Updated_Date that I would like to date displayed in. Am I missing something?


这篇关于如何在编辑表单上的字段时向表单添加日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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