How to quit access without saving current record.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Under an Add New record button I have
DoCmd.GoToRecord , , acNewRec

Under the Exit button I have:
response = MsgBox("Save data before exiting?", vbQuestion + vbYesNo, "Exit")
If response = vbNo Then
DoCmd.Quit (acQuitSaveNone)
End if

The record is still being saved. How do I get it to not
save the record?
 
Under an Add New record button I have
DoCmd.GoToRecord , , acNewRec

Under the Exit button I have:
response = MsgBox("Save data before exiting?", vbQuestion + vbYesNo, "Exit")
If response = vbNo Then
DoCmd.Quit (acQuitSaveNone)
End if

The record is still being saved. How do I get it to not
save the record?

The acQuitSaveNone parameter is talking about saving *design changes
to the structure of the form* - not the data.

Instead, try

If response = vbNo Then
Me.Undo
End If

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top