save before exit button

A

adrian

anyone have good example of save button?

looking for save button before exit, if table has been
changed i like to use msgbox to save yes or just exit if
no record has been added.
 
V

Van T. Dinh

Do you meant you want to ask the user whether he/she wants to save the
dirtied Record on closing / exiting the Form?

If so, you will need to use the Form_BeforeUpdate Event like:

****Untested****
Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim intResponse As Integer

intResponse = MsgBox("Save Record", vbYesNo, "Save Confirmation""

If intResponse = vbNo Then
Me.Undo
End If

End Sub
********
 

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