title: Me.Dirty is false within Form_Dirty() event! - VBA MS Access 2007
body: <p>How do you tell if the form is dirty within the <strong>OnDirty</strong> event (MS Access 2007)?  </p>
  
  <p>Consider this simple example, I'm calling out to a subroutine to validate some buttons within the <strong>Form_Dirty()</strong> event.</p>
  
  <pre><code>Private Sub Form_Dirty(Cancel As Integer)
      MsgBox Me.Dirty  
      ' The above line shows false, which makes the Me.Dirty property about as useful as tits on a bull!
      Call validateSaveCancelBtn
  End Sub   
  
  Private Sub validateSaveCancelBtn()
      btnCancel.ENABLED = Me.Dirty
      btnSave.ENABLED = Me.Dirty
  End Sub
  </code></pre>
  
  <p>And please don't tell me to just stick the code from <strong>validateSaveCancelBtn()</strong> into <strong>Form_Dirty()</strong> and hard-code it in there.  This is not gona work for me as I'm calling into the validateSaveCancelBtn() from other places too, and the actual logic is more complex than what I pasted here.  </p>