title: Avoid prompt to save form upon form close in MS Access
body: <p>I have a form with save and cancel button.</p>
  
  <p>When save is pressed and some required data was not provided, it prompts a message that data cannot be saved and I do some vba cosmetics to change the border of the controls that needed to be filled up. I change border colors in red and make it thicker.</p>
  
  <p>My problem is when this changes was triggered and the user decided not to submit the form data, upon click on cancel button, message pops asking the user if he wants to save changes made on the form which obviously I do not want that.</p>
  
  <p>I saw some suggestion in this post
  <a href="https://stackoverflow.com/questions/29756805/ms-access-prevent-prompt-to-save-form">MS Access - Prevent prompt to save form</a></p>
  
  <p>but reading on the documentation of the suggested answer, to me is not ideal to tun off all errors.</p>
  
  <p>I also found another possible solution using </p>
  
  <pre><code>DoCmd.Close acForm, "myform", acSaveNo
  </code></pre>
  
  <p>But it seems acSaveNo only applies to data changes not on the controls property changes.</p>
  
  <p>Is there any better way to avoid prompting form save and automatically discard any changes and close the form?</p>
  
  <p>Thanks</p>
  
  <p>EDIT: My code on changing form control appearance</p>
  
  <pre><code>Public Function InvalidBox(ByRef theBox As Control)
      theBox.BorderStyle = 1
      theBox.BorderColor = RGB(255, 0, 0)
      theBox.BorderWidth = 2
  End Function
  </code></pre>
  
  <p>On my cancel button I have this code</p>
  
  <pre><code>DoCmd.Close acForm, "myform", acSaveNo
  </code></pre>