Dirty Event

Dirty Event

See Also         Example         Macros         Event Procedures         Applies To

The Dirty event occurs 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. Examples of this event include entering a character directly in the text box or combo box or changing the control's Text property setting by using a macro or Visual Basic.

Notes

Remarks

To run a macro or event procedure when this event occurs, set the OnDirty property to the name of the macro or to [Event Procedure].

By running a macro or event procedure when a Dirty event occurs, you can determine if the record can be changed. You can also display a message and ask for edit permission.

Changing the data in a record by using the keyboard causes keyboard events to occur in addition to control events like the Dirty event. For example, if you move to a new record and type an ANSI character in a text box in the record, the following events occur in this order:

KeyDown Þ KeyPress Þ BeforeInsert Þ Dirty Þ KeyUp

The BeforeUpdate and AfterUpdate events for a record occur after you have entered the new or changed data in the record and moved to another record (or clicked Save Record on the Records menu), and therefore after the Dirty event for the record.