save before exit button

  • Thread starter Thread starter adrian
  • Start date Start date
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.
 
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
********
 
Back
Top