asking if to save changes?

  • Thread starter Thread starter hcs
  • Start date Start date
H

hcs

Hello,

how is it possible to make sure a user wishes to save the changes that they
have made to a record on a form by displaying a msg first?
this is as opposed to instantly saving the changes

cheers
 
Yes, use the BeforeUpdate event of the form. That's the event that fires
just before the record is saved.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbOkCancel) <> vbOk Then
Cancel = True
'Me.Undo
End If
End Sub
 
Back
Top