I'm using a msgbox to ask the user if they want to save changes in a continuous form for editing existing records. If they don't want to save before going to the next record, I have the acCmdUndo line in the code. It doesn't save the record and it sends the focus back where I want, but it doesn't change the form fields back to the existing record. Is there a way to do that or am I missing something?
Thanks for any help.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("You have Updated the Record" & vbCrLf & " Do You Want To Save It?",
vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'save record
Else
'Dont save it up
DoCmd.RunCommand acCmdUndo
Me!txtInvoice_Number.SetFocus
Exit Sub 'return to the form for correction.
End If
End Sub
Thanks for any help.