G
Guest
Hello,
I have some code attached to a cmdButton so that a user may send an email
from the form with the information from the current record. The code and
button works perfectly! However, if the user clicks the button an the email
appears and the users chooses NOT to send it after all, they get an error.
Here is the error they get:
Run Time Error '2501'
The SendObject action was cancelled.
Here is the code:
Private Sub Command39_Click()
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = ""
MySubject = "Issue"
MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " & Me.CustomerLast
& vbCr & Me.ErrorCode & _
vbCr & Me.Comments
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True
End Sub
Could someone please tell me how I can stop getting this error if they
choose not to send the email after clicking the button? Also, could you
please tell me where in this code it would go?
Thank you in advance!!
I have some code attached to a cmdButton so that a user may send an email
from the form with the information from the current record. The code and
button works perfectly! However, if the user clicks the button an the email
appears and the users chooses NOT to send it after all, they get an error.
Here is the error they get:
Run Time Error '2501'
The SendObject action was cancelled.
Here is the code:
Private Sub Command39_Click()
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = ""
MySubject = "Issue"
MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " & Me.CustomerLast
& vbCr & Me.ErrorCode & _
vbCr & Me.Comments
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True
End Sub
Could someone please tell me how I can stop getting this error if they
choose not to send the email after clicking the button? Also, could you
please tell me where in this code it would go?
Thank you in advance!!