title: How can I track Access crashes
body: <p>I was asked to add a new button on a couple DB forms.  The button changes the queue that the record is in, and then closes the form.  Nothing fancy.  I have the same button with the same code on three different forms.  On 2 of those forms, it works just as I'd expect.</p>
  
  <p>The button works fine every other time on the last form, and crashes Access on the other tries.  I've tried adding error logging, but it crashes prior to anything being logged.  I've stepped through the code and it crashes at <code>rs.Edit</code> in the below code...</p>
  
  <p>Code on the form behind the click event of the button: (each form has this behind the button)</p>
  
  <pre><code>Private Sub bRtD_Click()
  
    LogReturnToDashboard Me.Recordset
  
    DoCmd.Close acForm, Me.Name, acSaveNo
  
  End Sub
  </code></pre>
  
  <p>Called Function: (error handler removed since it isn't being triggered anyway, and to keep an already long post shorter)</p>
  
  <pre><code>Public Function LogReturnToDashboard(ByRef rs As DAO.Recordset)
  Dim sSQL As String
  Dim lLoc As Long
  
  'Get Dashboard
    lLoc = GetDashboard(rs!Role)
  
    sSQL = "INSERT INTO tblActivity ( Vendor, FromLocation, OldStatus, ToLocation ) " &amp; _
           "VALUES (" &amp; rs!VID &amp; ", " &amp; rs!Location &amp; ", " &amp; rs!Status &amp; ", " &amp; lLoc &amp; ");"
    CurrentDb.Execute (sSQL)
  
    rs.Edit    &lt;-------- This is where it crashes
    rs!Location = lLoc
    rs.Update
  
  End Function
  </code></pre>
  
  <p>The SQL command executes, I can check <code>tblActivity</code> and see the line with the record being changed back to the dashboard.</p>
  
  <p>Google-fu seems to return issues with ADODB recordsets crashing Access, but not DAO.</p>
  
  <p>And why would it literally work every other time?  I'm at a loss.  I clearly can't publish this when it crashes this consistently.</p>
  
  <p>I checked the AppLog and found this entry, but this doesn't tell me much.  This seems to be a generic error for the Office Suite as Google returns pages that declare the problem is every piece of the suite.</p>
  
  <p><a href="https://i.stack.imgur.com/v1IPl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v1IPl.jpg" alt="Access Error"></a></p>
  
  <p>Any ideas?  Just having a better idea of where to look would be great, I've searched every part of the error log, and nothing seems specific to Access.</p>
  
  <p><strong>UPDATE:</strong>
  So far I have:<br>
   - Created a new DB and imported everything....reset references...etc<br>
   - Created brand new forms and copied all content.<br>
   - Decompiled the DB<br>
   - Stepped through code behind buttons that seem to crash more often than others...Did NOT find that they crash in similar parts.  (I now have other buttons that are causing Access to crash besides the original one here...none of the others crash at <code>rs.edit</code> btw)<br>
   - Downloaded a different version of acedao.dll<br>
   - Posted on the MS site hoping to get more answers...  </p>
  
  <p>So far, I still can't seem to make any progress on preventing these crashes.</p>