How to diagnose MS access crashes

前端 未结 5 799
南旧
南旧 2020-11-27 07:02

We have a custom program written in Access that has odd crashes in it. We have added error handling that records and emails any crashes that happen inside of our own code a

5条回答
  •  猫巷女王i
    2020-11-27 07:58

    Every single function on every single form in every single Access database should have a flow that looks like this:

    Private Sub btnMyButton_Click()
    Dim MyVar as String
    On Error GoTo ErrorHappened
    
    'Do some stuff here...
    
    ExitNow:
        Exit Sub
    
    ErrorHappened:
        MsgBox Err.Description
        Resume ExitNow
    End Sub
    

    In the ErrorHappened section, you can have it write to your table that tracks bugs. If you change all of your Subs and Functions to flow like this, you should be able to trap every single issue your database has. Maybe write out the Err.Number as well as Err.Description.

提交回复
热议问题