问题描述
在表单中,当您到达新记录时,会触发哪些事件以及
哪个对象?我找不到这样的事件。我需要在
用户到达下一条记录时重置一个值。
谢谢,
john
In a form, when you arrive in a new record, what event is trigerred and in
which object? I can''t find such an event. I need to reset a value when the
user arrives in a next record.
Thanks,
john
推荐答案
如果我在表单中并按导航按钮移动到新的
记录,我可以通过以下方式检查记录的状态:询问
如果Me.NewRecord那么
当你去任何绑定的表格记录时(表格与
表相关联/在记录源中查询),无论是新记录还是现有记录,OnCurrent事件都会触发每个
记录。
If I am in a form and I press the navigation button to move to a new
record, I can check for the record''s state by asking
If Me.NewRecord Then
When you go to any bound form record (form is associated with a
table/query in the recordsource), the OnCurrent event fires for each
record regardless whether it is a new or existing record.
只要当前记录发生变化,就会触发当前事件。
表单'的NewRecord属性将指示当前是否
记录是一张新纪录。
Sub Form_Current()
如果Me.NewRecord那么
''只是到了一个新纪录
否则
''到达现有记录
结束如果
-
Marsh
The Current event fires whenever the current record changes.
The form''s NewRecord property will indicate if the current
record is a new record.
Sub Form_Current()
If Me.NewRecord Then
''just arrived at a new record
Else
''arrived at an existing record
End If
--
Marsh
这篇关于捕获新的记录事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!