ACC: How to Create an Undo Record Button on a FormLast reviewed: October 24, 1997Article ID: Q101079 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. Microsoft Access versions 1.x and 2.0 do not have a built in way to undo changes made to the current record. This article demonstrates a sample user-defined Access Basic function that you can use to undo changes made to the current record. NOTE: In Microsoft Access for Windows 95 version 7.0, you can create a button to undo the current record by using the Command Button Wizard. For more information about the undo record command button, search for "Undoes," and then "Create Command Button That Adds, Deletes, Duplicates, Prints, Saves, And Undoes Current Record" using the Microsoft Access for Windows 95 Help Index. NOTE: This article explains a technique demonstrated in the sample files, FrmSampl.exe (for Microsoft Access for Windows 95 version 7.0) and FrmSmp97.exe (for Microsoft Access 97). For information about how to obtain these sample files, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q150895 TITLE : ACC95: Microsoft Access Sample Forms Available on MSL ARTICLE-ID: Q175066 TITLE : ACC97: Microsoft Access 97 Sample Forms Available on MSL MORE INFORMATIONTo undo the changes to the current record, you can use the DoMenuItem macro action to choose Undo Current Record from the Edit menu. However, this menu item is available only when there are changes to undo. Attempting to use the DoMenuItem action when no changes have been made to the current record causes the following error message to appear:
Command not available: UndoCurrentRecordThis article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Access Basic, please refer to the "Introduction to Programming" manual in Access version 1.x or the "Building Applications" manual in Access version 2.0. The following is a module using the Access Basic function UndoRecord(), which allows you to undo the current record, whether or not the record has been changed, or "dirtied":
REFERENCESFor more information about the command DoMenuItem, search for "DoMenuItem" using the Microsoft Access Help menu. Keywords : FmsEvnt kbusage Version : 1.0 1.1 2.0 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |