HOW TO: Automatically Detect If a Form Is Being Edited in Access 2000
This article was previously published under Q210334 On This PageSUMMARY
This article describes two techniques that you can use to automatically run
code when a form's Edit mode changes. You can use these techniques when you want to have different controls available on a form when a record is being
edited and when a record is not being edited.
NOTE: This article explains a technique demonstrated in the sample file, FrmSmp00.mdb. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base: 233324 (http://support.microsoft.com/kb/233324/EN-US/) ACC2000: Microsoft Access Sample Forms Database Available in Download Center
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. When Access displays a pencil symbol in the record selector, the record is being edited, but it has not yet been saved. When Access displays a triangle symbol in the record selector, the record has been saved and is not being edited. Note that if the form's RecordSelector property is set to No, these symbols are not displayed. There are two methods that you can use to automatically run code when a form's Edit mode changes:
The following examples demonstrate how to use these techniques to automatically enable or disable an Undo Record button, depending on a form's Edit mode. Method 1: Using the Form's Timer Event
Method 2: Using the Dirty Property in an Expression
REFERENCESFor more information about the Dirty property, click Microsoft Access Help on the Help menu, type the Dirty property in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For more information about Timer event, click Microsoft Access Help on the Help menu, type Timer event in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|

Back to the top
