I'm running office 2000 with A2K
I have a button on my form that when pressed takes some info from the form and places it in the body of an email. Everything works fine if the user does what they are supposed to...but we all know we can't count on that.
When outlook opens and the user decides they don't want to send an email after all and just closes outlook, this error pops up... "Run Time Error 2501 The SendObject Action was cancelled" then there's END and DEBUG.
I do not want the user to be able to hit DEBUG and get into my code. Here's my code:
Private Sub cmdEmail_Click()
MsgBox "Please be patient this will take a minute", vbInformation, "Be Patient"
DoCmd.SendObject , , , , , , "Trouble Ticket", _
"Ticket Date: " & Me.TicketDate & vbCrLf & "User: " & Me.UserFirstName & vbCrLf & _
"Problem Description: " & Me.ProblemDescription, False
End Sub
I've tried using if err.code = 2501
On err goto
and others, I don't think I have the syntax or order right though.
Any ideas? Thanks!
Amy
I have a button on my form that when pressed takes some info from the form and places it in the body of an email. Everything works fine if the user does what they are supposed to...but we all know we can't count on that.
When outlook opens and the user decides they don't want to send an email after all and just closes outlook, this error pops up... "Run Time Error 2501 The SendObject Action was cancelled" then there's END and DEBUG.
I do not want the user to be able to hit DEBUG and get into my code. Here's my code:
Private Sub cmdEmail_Click()
MsgBox "Please be patient this will take a minute", vbInformation, "Be Patient"
DoCmd.SendObject , , , , , , "Trouble Ticket", _
"Ticket Date: " & Me.TicketDate & vbCrLf & "User: " & Me.UserFirstName & vbCrLf & _
"Problem Description: " & Me.ProblemDescription, False
End Sub
I've tried using if err.code = 2501
On err goto
and others, I don't think I have the syntax or order right though.
Any ideas? Thanks!
Amy