自动更新日期 [英] Auto Update a Date

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

问题描述

我正在尝试在Access 2007表单中创建一个字段,当您修改表单中的任何内容时,它会更新日期。


换句话说,我有一个日期更新。只有在表单上修改了某些内容时,才需要自动更新的字段。


我是新手,所以请一步一步解释一下!


谢谢!!!

解决方案

最好在表格中添加一些代码。

1)在设计模式下打开表格并直接按[属性]按钮。

2)转到事件选项卡,然后双击BeforeUpdate。文本,因此字段填充文本Eventprocedure。

3)按文本后面的[..]按钮,将打开一些预先创建的活动VBA代码。

4)在sub中键入:

展开 | 选择 | Wrap | 行号



最好在表单中添加一些代码。

1)在设计模式下打开表单并直接按[属性]按钮。

2)转到事件选项卡并加倍 - 点击BeforeUpdate文本,因此字段填充文本Eventprocedure。

3)按文本后面的[..]按钮,将打开一些预先创建的活动VBA代码。

4)在sub中键入:

展开 | 选择 | Wrap | 行号


奇怪,仅在更改时触发BeforeUpdate对表格做了,因此它只是你需要的事件。


你确定日期字段的字段名(见属性的另一个标签下)是对吗?


Nic; o )

I am trying to create a field in my Access 2007 form where, when you modify anything in the form it updates the date.

In other words, I have a "Date Update" field that I need to automatically update, only when something is modified on the form.

I''m a novice, so please explain in step by step terms!

Thank you!!!

解决方案

Best to add some code to the form.
1) Open the form in design mode and directly press the [Properties] button.
2) Goto the Events tab and double-click the "BeforeUpdate" text so the field is filled with the text "Eventprocedure".
3) Press the [..] button behind the text and some pre created VBA code for the event will open.
4) Type within the sub:

Expand|Select|Wrap|Line Numbers


Best to add some code to the form.
1) Open the form in design mode and directly press the [Properties] button.
2) Goto the Events tab and double-click the "BeforeUpdate" text so the field is filled with the text "Eventprocedure".
3) Press the [..] button behind the text and some pre created VBA code for the event will open.
4) Type within the sub:

Expand|Select|Wrap|Line Numbers


Strange, the BeforeUpdate is only triggered when a change has been made to the form, thus it''s just the event you need.

Did you make sure that the fieldname (see under the other tab of the properties) of the date field is correct ?

Nic;o)


这篇关于自动更新日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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