title: How do I implement transactions in Access?
body: <p>I am stuck implementing a transaction/rollaback feature on an access form.</p>
  
  <p>Here's the stripped down outline of what I've done:</p>
  
  <p>In the form's Load handler, I start the transaction</p>
  
  <pre><code>dbEngine.BeginTrans
  gInTransaction = true
  </code></pre>
  
  <p>Then, there's a "Cancel" button, whose Click handler goes like</p>
  
  <pre><code>dbEngine.Rollback
  gInTransaction = false
  doCmd.close acForm, "frmName"
  </code></pre>
  
  <p>Finally, the form's Unload handler has:</p>
  
  <pre><code>if gInTransaction then
      dbEngine.CommitTrans
      gInTransaction = false ' just in case
  end if
  </code></pre>
  
  <p>Now, there seem to be no effect on the form regarding the rollback. Pressing the "Cancel" button does not seem to rollback anything. </p>
  
  <p>I also tried replacing dbEngine with dbEngine.workspaces(0), with no effect either.</p>
  
  <p>So, the question is: how do I implement transaction in Access?</p>
  
  <p>Thanks for any pointer into the right direction,
  Rene</p>