Raising an Error
Sub TestRaiseError() On Error GoTo TestRaiseError_Err Dim sngResult As String Err.Raise 11 Exit Sub TestRaiseError_Err: msgBox "Error #" & Err.number & ": " & Err.Description Exit Sub End Sub