One think you could do is ask the user if they want to save the record or undo the changes they made. You can you the Forms BeforeUpdate Event to do this.
Example
--------
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed. Do you wish to save the changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?" = vbYes Then
'do nothing
Else
DoCmd.RunCommand acCmdUndo
End If
End Sub
Bernadette,
Could you explain the DoCmd.RunCommand acCmdUndo
code a little more? I'm trying to do something similar, and I'm getting a Runtime error 2046, The command or action 'Undo' isn't available now. Can the command only be ran at certain times?
I have a subform on my form, and I think what's happening is that my information is being entered into table as soon as I go to subform...is there another code could I use to undo this? ( Do I have to use a delete query? )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.