over ride save behavior

  • Thread starter Thread starter j_70
  • Start date Start date
J

j_70

I have a form that I would like to modify the save
behavior of having the record saved either when the form
is closed or you move to another record. What I would like
is that the record only be saved if the user explicitly
says 'yes, save record'. TIA
 
The only way to trap this in a bound form is to use the Before Update event
procedure of the form:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbYesNo) <> vbYes Then
Cancel = True
End If
End Sub

If you want to cancel the entry, add:
Me.Undo
after the Cancel line.
 
Back
Top