Automatically generating handling of issues

前端 未结 5 667
旧时难觅i
旧时难觅i 2020-11-27 18:53

This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and

5条回答
  •  粉色の甜心
    2020-11-27 19:33

    What about using "Erl", it will display the last label before the error (e.g., 10, 20, or 30)?

    Private Sub mySUB()
    On Error GoTo Err_mySUB
    10:
        Dim stDocName As String
        Dim stLinkCriteria As String
    20:
        stDocName = "MyDoc"
    30:
        DoCmd.openform stDocName, acFormDS, , stLinkCriteria    
    Exit_mySUB:
        Exit Sub
    Err_mySUB:
        MsgBox Err.Number & ": " & Err.Description & " (" & Erl & ")"
        Resume Exit_mySUB
    End Sub
    

提交回复
热议问题