title: Access VBA: Is it possible to reset error handling?
body: <p>I am using in the first part of my program</p>
  <p><code>On Error GoTo start</code></p>
  <p>Suppose in my second part I am again using</p>
  <p><code>On Error Resume Next</code></p>
  <p>This second error trap will not get activated as the first one will still be active. Is there any way to de-activate the first error handler after it has been used?</p>
  <pre class="lang-vb prettyprint-override"><code>Set objexcel = CreateObject(&quot;excel.Application&quot;)
                       objexcel.Visible = True
                       On Error GoTo Openwb
                       wbExists = False
                       Set wbexcel = objexcel.Workbooks.Open(&quot;C:\REPORT3.xls&quot;)
                       Set objSht = wbexcel.Worksheets(&quot;Sheet1&quot;)
                       objSht.Activate
                       wbExists = True
  Openwb:
                       
                       On Error GoTo 0
                       If Not wbExists Then
                       objexcel.Workbooks.Add
                       Set wbexcel = objexcel.ActiveWorkbook
                       Set objSht = wbexcel.Worksheets(&quot;Sheet1&quot;)
  
                       End If
                       
                       On Error GoTo 0
                                           
  Set db = DBEngine.opendatabase(&quot;C:\book.mdb&quot;)
  Set rs = db.OpenRecordset(&quot;records&quot;)
  
  Set rs2 = CreateObject(&quot;ADODB.Recordset&quot;)
  rs2.ActiveConnection = CurrentProject.Connection
  
  
  For Each tdf In CurrentDb.TableDefs
     
     If Left(tdf.Name, 4) &lt;&gt; &quot;MSys&quot; Then
          rs.MoveFirst
          strsql = &quot;SELECT * From [&quot; &amp; tdf.Name &amp; &quot;] WHERE s=15 &quot;
  
          Do While Not rs.EOF
              On Error Resume Next
              
              rs2.Open strsql 
  </code></pre>
  <p>Upon execution of the last statement I want to ignore the error and move on to the next table but error handling does not seem to work.</p>