How to quit access without saving current record.

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?
 
J

John Vinson

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
 

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