I'm trying to make it so that if I leave a record without saving it, the changes aren't saved. A message asking if you want to save the changes would be nice. I just don't want someone to accidentally make a change and then go onto the next record and the information is saved. From what I have been reading online, I'm guessing that I need something in the BeforeUpdate event, but I don't know what. I'm using Access 2010.
How to turn off autosave?
Collapse
X
-
Tags: None
-
Something alone these lines should work:
Code:Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String Dim intResponse As Integer strMsg = "You have made one or more changes to this Record. Do you wish to Save this Record " & _ "with those changes?" & vbCrLf & vbCrLf & "Click Yes to Save changes, or Cancel to " & _ "UNDO these changes?" intResponse = MsgBox(strMsg, vbQuestion + vbOKCancel + vbDefaultButton1, "Promopt to Save Record") If intResponse = vbCancel Then DoCmd.RunCommand acCmdUndo End If End Sub
-
Will this make it so that for each field you will have to hit yes, or when you try to leave the current record all fields will be saved or not?Comment
-
-
Comment