I wrote up a generic error handler that I want to use to handle all errors in each sub routine of my form. For some reason it never gives me an error description. I've also tried the "Error$" instead of "Err.Description" but have no luck. Any help would be greatly appreciated. Here's the code:
Code:
Private Sub ErrRoutine()
On Error GoTo Err_Handler
'This sub routine sends an e-mail to notify
'the engineer of a database error and gives
'user an error message.
MsgBox "Error " & Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical
Call EMailNames
DoCmd.SendObject , "", "", strErrEmail, "", "", _
"Nickel/Gold Plating Database Error!", _
Now() & vbCrLf & vbCrLf & _
"Error " & Err.Number & " - " & Err.Description & vbCrLf & vbCrLf & _
"Sub Routine: " & strErrSubRoutine & " in the Main Page.", _
False, ""
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical
Resume Exit_Handler
End Sub