first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Thinking of the BeforeUpdate and AfterUpdate Events in DAO Terms; the Change Event Is Different from the BeforeUpdate Event

In order to distinguish the BeforeUpdate event from the Change event, think of the BeforeUpdate event and AfterUpdate event in DAO transaction terms. The BeforeUpdate event fires just before a transaction is committed to the database. It marks the time when a BeginTrans method would be called out of the Workspace object.

It follows that the AfterUpdate event fires when a CommitTrans method would be called. One can emulate the Rollback method of the Workspace by setting Cancel = True during a BeforeUpdate event procedure or implement an Undo routine by saving the OldValue property of the control that supports BeforeUpdate and AfterUpdate events.

The BeforeUpdate and AfterUpdate events fire in succession after the supporting control loses focus; whereas the Change event fires as soon as data in the control is altered by the user. The Change event continues to fire with every edit the user makes. This can make the change event very dangerous for text boxes where the user can make many changes before the control loses focus.

mod date: 1998-09-18T23:39:29.000Z