On Fri, 6 Aug 2010 23:28:46 -0400, "LAS" <(E-Mail Removed)> wrote:
>Since Access doesn't require an explicity save when records are created or
>modified in a form, what is the best way to allow the user to undo what they
>have done before leaving a record?
>
>tia
>las
>
1. Teach them that hitting <Esc> twice will cancel the edit.
2. Put a command button on the form which executes a Me.Undo action.
3. (worst choice IMO since users will just click OK anyway) Put code in the
Form's BeforeUpdate event to make them verify that they want to save:
Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
iAns = MsgBox("Okay to save?", vbOkCancel)
If iAns = vbCancel Then
Cancel = True
Me.Undo
End If
End Sub
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com