ACC: UndoCurrentRecord in BeforeUpdate Property Causes Error

Last reviewed: April 2, 1997
Article ID: Q97525
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

If you create a macro that contains a DoMenuItem action that chooses Undo Current Record from the Edit menu, and you run the macro from a form's BeforeUpdate property, you may receive the following error message when you edit data in the form:

   Command not available: UndoCurrentRecord.

However, if you select the Edit menu, Undo Current Record is available and works properly.

CAUSE

The Undo Current Record command is not available for use with a macro run from a form's BeforeUpdate property.

STATUS

This behavior no longer occurs in Microsoft Access version 7.0.

RESOLUTION

In your macro, enter CancelEvent as the first action, and then follow that with the SendKeys action to send an ESC key. (This has the same effect as choosing the Undo Current Field command from the Edit menu.)

MORE INFORMATION

Page 48 of the Microsoft Access "Language Reference," versions 1.0 and 1.1, discusses uses for this type of macro in the BeforeUpdate property, and indicates that calling Undo Current Record works correctly in such a macro. This is not the case. Calling Undo Current Record causes the error message above and should not be used.

REFERENCES

Microsoft Access "Language Reference," versions 1.0 and 1.1, "BeforeUpdate, AfterUpdate Properties," pages 47-48


Additional query words: kberrmsg
Keywords : kbusage McrActn
Version : 1.0 1.1 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.