title: Preventing close buttons from saving records in MS Access
body: <p>In a Microsoft Access form, whenever the current record changes, any changes in bound controls are silently saved to the database tables. This is fine, but I don't want it to happen when a user closes a form, because it is the direct opposite of what many people would expect.</p>
  
  <p>The best example is when you try to close an excel file with unsaved changes, it asks whether the changes should be discarded. This is exactly what I'm trying to achieve in Access, but can't find any way to trap the close button's event in VBA.</p>
  
  <p>The form's Unload event is the first event that is triggered when someone clicks the close button, but by then the changes are already written to the database.</p>
  
  <p>Is this at all possible, or do I have to create my own close buttons? I'm comfortable with writing large amounts of code for trivial things like this but I hate having to clutter the GUI.</p>