Well, I didn't want to suggest this, but there's always SendKeys "{ESC}"
--
Danny J. Lesandrini
dlesandrini@hotmail.com http://amazecreations.com/datafast/
"Alan Oats" <chrazer@gmail.com> wrote in message news:43400db9$1_1@news.bluewin.ch...[color=blue]
> That works partially. It stops the record update. It does not however return the changed records to its original
> format. The only way is by using the escape key. It is an improvement but adds a little complexity to the user
> interface.
>
> Thankyou for the help I am at least one step further with this tip.
>
>
>
> Alan
>
>
> "Danny J. Lesandrini" <dlesandrini@hotmail.com> schrieb im Newsbeitrag
> news:f8qdnYmC_I0kaKLenZ2dnUVZ_sidnZ2d@comcast.com. ..[color=green]
>> Try replacing the line ...
>> DoCmd.RunCommand acCmdUndo
>>
>> With
>> Cancel = True
>>
>> --
>>
>> Danny J. Lesandrini
>>
dlesandrini@hotmail.com
>>
http://amazecreations.com/datafast/
>>
>>
>>
>> "Alan Oats" <chrazer@gmail.com> wrote in message news:433fef06_3@news.bluewin.ch...[color=darkred]
>>>I want to use this code from
http://www.mvps.org/access/forms/frm0027.htm
>>>
>>>
>>> Private Sub Form_BeforeUpdate(Cancel As Integer)
>>> Dim strMsg As String
>>> strMsg = "Data has changed."
>>> strMsg = strMsg & "@Do you wish to save the changes?"
>>> strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
>>> If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
>>> 'do nothing
>>> Else
>>> DoCmd.RunCommand acCmdUndo
>>>
>>> 'For Access 95, use DoMenuItem instead
>>> 'DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
>>> End If
>>> End Sub
>>>
>>>
>>> For me in Access 2003 "German" this does not function.
>>>
>>> the code breaks and reports that this function is not available at the moment.
>>>
>>> Thanks Alan
>>>[/color]
>>
>>[/color]
>
>[/color]