检测与表单事件数据的变化 [英] Detecting data changes with Form events

查看:118
本文介绍了检测与表单事件数据的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你读过我最近的其他问题,你已经prob'ly拿起我不是的真正的访问开发商....我的大部分背景是在VB中,在那里我刻苦钻研避免绑定控件。

If you've read my other recent questions, you've prob'ly picked up that I'm not really an Access developer.... Most of my background is in VB, where I assiduously avoided bound controls.

现在我在2007年访问我工作我有一个是基于一个表(当然,单表查询)的形式,并在其子窗体基于一个一对多子表。我想,以检测在这些形式的数据用户所做的更改,这样我可以更新父表的日期戳。实际日期字段不被显示给用户(至少不在这里)。

Now I'm working in Access 2007. I have form that's based on a table (well, a single-table query), and a subform upon it based on a one-to-many child table. I want to detect user-made changes in the data on either of these forms so that I can update a date stamp in the parent table. The actual date field is not being shown to the user (at least not here).

什么是适当的情况下赶上的事实已被更改?我应该怎样做实际的变化(直接到form.Recordset的DateField |!有一个隐藏的绑定文本框|其他方式)?

What would be the appropriate event to catch the fact that the change has been made? How should I make the actual change (direct to form.Recordset!dateField | with a hidden bound text box | some other way)?

推荐答案

你必须去寻找更新后事件,当绑定控件的更新内容基础记录更新其解雇。

You'll have to look for the afterupdate event, which is fired when the updated content of a bound control is updated in the underlying recordset.

在此事件过程中,你应该能够编写所需的指令更新日期字段。这是没有必要将它绑定到窗体上的任何控制,只要该字段是在记录!

In this event procedure, you should be able to write the needed instruction to update your date field. It is not necessary to have it bound to any control on the form, as long as the field is in the recordset!

这篇关于检测与表单事件数据的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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