Discussion Locked

Rollback in Access

0 helpful
1 reply
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?

1 reply

by seagull data services

Depends on whether you're using a form with a recordset behind it or not.
If you are then pressing the Esc key once will undo the current field, pressing it twice will undo changes to the current record. No code required.

If you're using a form with no recordset attached (i.e. reading/writing to the recordset in code) then simply reading the current record back into the form will do the trick. If you use a flag to indicate changes, don't forget to re-set it.
HTH
John

This discussion is closed to new replies.