Parasyke wrote:
I have an email Sub set up that works fine except upon a successful
send I get a blank message box with just an OK button. How can I change
this to read something different? I have no event handler at all set up
yet, but still get the MsgBox... Thanks!
You are getting the blank mailbox because there is nothing telling this
routine to ext the sub. So it goes on until it hits your msgbox - there
is no error, so the msgbox appears with no err.description.
Your code would be better structured this way:
Private Sub SendEmail_Click()
On Error GoTo Err_SendEmail_Click
DoCmd.SendObject acSendNoObject, , , "Jo*****@ABCDE.com", , "Database
maintenance notice", _
"The Sales database can be re-opened and used as normal.", , _
False
Exit_Proc:
Exit Sub
Err_SendEmail_Click:
MsgBox Err.Description
resume Exit_Proc
End Sub
My standard proc exit and error handler goes something like this:
Exit_Proc:
Exit Sub
Err_Proc:
Select Case Err.Number
Case whatever
'handle specific error
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description, _
vbCritical, _
"Name_Of_Procedure", _
Err.HelpFile, Err.HelpContext
Resume Exit_Proc
End Select
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me