KenHigg
08-23-2007, 11:56 AM
I have docmd.sendobject that opens Outlook to send an email, etc. However if the user does not send the email and cancels out of the message Access is asking the user if they want to debug. How can I simply have Access return to where the user was before they hit the command button that launched Outlook. I don't want them to go into the code. In fact I don't even want a message of any type - I thought I could trap the cancel somehow and code for it...
Thanks,
Ken
pbaldy
08-23-2007, 12:17 PM
You can trap for error 2501 in the event containing the SendObject.
KenHigg
08-23-2007, 12:24 PM
If error = 2501 then exit the sub?
pbaldy
08-23-2007, 12:57 PM
Well, I would use traditional error trapping code. Are you familiar with that? I searched here for "sendobject 2501" and found several threads, including these:
http://www.access-programmers.co.uk/forums/showthread.php?t=61225
http://www.access-programmers.co.uk/forums/showthread.php?t=82660
KenHigg
08-23-2007, 01:59 PM
Ah - I remember now. Thanks a million! I did a search, just not very good - sorry.
Ken