Discussion Locked

Rollback in Access

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am writing some code that allows the user to cancel any changes that they have made, i therefore need to use the esc key function, what is the code behind it?

5 replies

by donq

The simple answer is to use the sendkeys statement:

SendKeys "{ESC}", False

The True / False part tells Access to wait until the user does something (True) or instructsto do the rollback now!

by jmplancke

OK answer 1 is not bad but...
The escape key cancel only the last "update" which means only the last modified field; to undo all the changed fields, you need to send 2 escape keys.
There is also a way to undo a saved record with the CTRL Z which should be written sendkeys "^Z"

This discussion is closed to new replies.