Data events occur when data is entered, deleted, or changed in a form or control, or when the focus moves from one record to another.
Event | Event property | It occurs |
---|---|---|
AfterDelConfirm | AfterDelConfirm (forms) | After you confirm record deletions and the records are actually deleted, or after the deletions are canceled. |
AfterInsert | AfterInsert (forms) | After a new record is added to the database. |
AfterUpdate | AfterUpdate (forms, controls) | After a control or record is updated with changed data. This event occurs when the control or record loses the focus, or you click Save Record on the Records menu. This event occurs for new and existing records. |
BeforeDelConfirm | BeforeDelConfirm (forms) | After one or more records are deleted, but before Microsoft Access displays a dialog box asking you to confirm or cancel the deletion. This event occurs after the Delete event. |
BeforeInsert | BeforeInsert (forms) | When you type the first character in a new record, but before the record is added to the database. |
BeforeUpdate | BeforeUpdate (forms, controls) | Before a control or record is updated with changed data. This event occurs when the control or record loses the focus, or you click Save Record on the Records menu. This event occurs for new and existing records. |
Change | OnChange (controls) | When the contents of a text box or the text box portion of a combo box changes; for example, when you type a character in the control or change the Text property of the control by using a macro or Visual Basic. |
Current | OnCurrent (forms) | When the focus moves to a record, making it the current record, or when you requery a form's source of data. This event occurs when a form is first opened, and whenever the focus leaves one record and moves to another. It also occurs when you requery the source of the data for a form; for example, when you click Remove Filter/Sort on the Records menu, or use the ShowAllRecords action or the Requery action. |
Delete | OnDelete (forms) | When a record is deleted, but before the deletion is confirmed and actually performed. |
Dirty | OnDirty (forms) | When the contents of a form or the text portion of a combo box changes. It also occurs when you move from one page to another page in a tab control. |
NotInList | OnNotInList (controls) | When a value is entered in a combo box that isn't in the combo box list. |
Updated | OnUpdated (controls) | When an OLE object's data has been modified. |