[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 499
  • Last Modified:

Error not being trapped

*** The below error 3265 doesn't result in the code hitting the Err_Proc -- it breaks on the line with the error...


Private Sub DeleteLinks()
On Error GoTo Err_Proc

    Dim db As DAO.Database
    Dim td As DAO.TableDef
    Dim rs As DAO.Recordset

    Set db = CurrentDb()
    Set td = db.TableDefs("tblODBCDataSources")
    Set rs = td.OpenRecordset
   
    Do Until rs.EOF = True
        db.TableDefs.Delete rs!LocalTableName <---------
        rs.MoveNext
    Loop

   rs.Close
   
Exit_Proc:
    Exit Sub
   
Err_Proc:
    Select Case Err.Number
        Case 3265   'item not found in this collection *** Should be getting trapped here
            Resume Next
        Case Else
            MsgBox Err.Number & "--" & Err.Description, vbCritical
            Resume Exit_Proc
    End Select
   
End Sub
0
Eileen Murphy
Asked:
Eileen Murphy
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
err
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
VBA editor>>Tools>>Options ... General
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
Oh for heaven's sake.... I'm a dork. Should have checked that. That was the problem. Thanks a lot!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now