all,
Through error handling I use I got an error # 287. I usually go http://www.fmsinc.com/microsoftaccess/errors/ErrorNumber_Description2007.html for descriptions but this isn't listed. The description the error handling gave, which is listed a number of times, "Application-defined orobject defined error" which I understand since it was Access 2007 using Vba to create an email in Outlook 2010, and failed. I am more interested in why is not listed. Maybe there is an issue with my error handling or I'm missing something, any ideas?
thanks
here is the code, which was written by some else, i added the error handling to this error handling function:
Public Function ShowError(strModule As String, strForm As String, _
lngErrorNumber As Long, strErrorDescription As String)
'* Purpose: To create a central error handling mechanism.
'* Accepts: strModule - name of the module, where the error was from (form, class, ect)
'* strprocedure - the name of the procedure where the error occured
'* lngErrorNumber - the numeric error identifier
'* strErrorDescription - the text description of the error
On Error GoTo PROC_ERR
Dim strMessage As String
Dim strCaption As String
'* Build the error message
strMessage = "Pease look into this issue. " & vbCr & vbCr & _
"Please provide detailed information and explain exactly what you were doing when this error occurred. the automatic information is limited when finding a solution." & vbCr & vbCr & _
"Error # " & lngErrorNumber & " : " & strErrorDescription & vbCr & _
"Module: " & strModule & vbCr & _
"Form: " & strForm
'* Build the caption for the msgbox
strCaption = "Unexpected Error! "
'MsgBox strMessage, vbCritical, strCaption
Dim myMail As MailItem
'Set objOutlook = CreateObject("Outlook.Application")
Set myMail = CreateItem(olMailItem)
With myMail
.Recipients.Add ("XXX")
.Subject = strCaption
.Body = strMessage
.Display
'.Send
End With
MsgBox "Please Send Error Email", vbCritical, strCaption
PROC_EXIT:
Exit Function
PROC_ERR:
Select Case lngErrorNumber
Case 462
MsgBox "Emails cannot be created. Please restart the DB, then try again.", vbCritical, "Email Error, a message from the IT Dept."
GoTo PROC_EXIT
Case Else
MsgBox "It seems there may be a problem sending emails so please get this info to IT Module: " & strModule & " Error # " & lngErrorNumber & " : " & strErrorDescription, vbCritical, "Error- in error handling"
GoTo PROC_EXIT
End Select
End Function