over ride save behavior

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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top