If you are using a close button that you build yourself, and you don't wish to save you can try:
DoCmd.Close , , acSaveNo
or even if you wish to save
DoCmd.Close , , acSaveYes
If you are using the little X at the top, you might be able to add this code in the "On Close" event, but I've never...