I've added the following to a form feild named Email so that people can just click on the email address on the for to fire up their default email program with the address, subject and intro text "Dear John" already inputted.
The problem I'm having is that I'm getting a runtime error 2501 when you exit (X) the email without actually sending it. Is there something I need to add to the script below to catch this error without giving an error/debug message everytime as the "you've cancelled your email message" doesn't seem
to work . . .
Thanx in advance.
Private Sub EMail_Click()
DoCmd.SendObject acSendNoObject, ObjectName = stDocName, outputformat:=acFormatRTF, to:=EMail, subject:="RE:", Messagetext:="Dear " &
[ID_FirstName]
Exit_EMail_Click:
Exit Sub
Err_Email_Click:
strMsg = "You have cancelled your Email"
MsgBox strMsg
Resume Exit_EMail_Click
End Sub
The problem I'm having is that I'm getting a runtime error 2501 when you exit (X) the email without actually sending it. Is there something I need to add to the script below to catch this error without giving an error/debug message everytime as the "you've cancelled your email message" doesn't seem
to work . . .
Thanx in advance.
Private Sub EMail_Click()
DoCmd.SendObject acSendNoObject, ObjectName = stDocName, outputformat:=acFormatRTF, to:=EMail, subject:="RE:", Messagetext:="Dear " &
[ID_FirstName]
Exit_EMail_Click:
Exit Sub
Err_Email_Click:
strMsg = "You have cancelled your Email"
MsgBox strMsg
Resume Exit_EMail_Click
End Sub