Re: stop code sending cancelled email

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



thanks for your help. as you say it either goes or doesnt. i tried the save
but still have to click x to exit as the screen seems to be locked and at
that stage it goes! Will just have to impress on my users that send means
send. Is there a reason why it locks the message screen

Thanks

"Allen Browne" wrote:

From Access' point of view, SendObject either succeeds (the email goes) or
fails (it did not go.)

If you want to save if for later, try hitting the Save button in your email
program. This should save it somewhere (inbox or drafts or something.) Then
close the email without sending (your X button.) The cancel triggers error
2501 in Access, which you can trap and ignore. But if you saved it before
cancelling, it should still be available in your email software later.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"judith" <judith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C078FAA7-FD79-4060-89D2-350196BE9710@xxxxxxxxxxxxxxxx
yes the send button works fine. in fact i think it does an immediate send
rather than wait for the schedule but it certainly goes. I am puzzled as
to
why the x button does not just put it into drafts

"Alex Dybenko" wrote:

Hi,
will it work, if you click on send button, instead of x button on email
message?

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


"judith" <judith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:53ECA0A2-0DD8-4E80-9591-FA673BCA6464@xxxxxxxxxxxxxxxx
Oops, sorry thought the error handling was working but it seems not. It
looks
as though as soon as it goes to the satement

DoCmd.SendObject acSendNoObject, "", acFormatTXT, strTo, , ,
strSubject,
strBody & strTemplate

it locks itself. I cant navigate away from the email window and it also
seems at that point to have put the email in the outbox.
I am using a procedure from
'A procedure to send report in a body of mail message
'Alex Dybenko, http://Alex.Dybenko.com
as i need to convert the access report to email body text but cant see
that
that is having any effect.

Any suggestions please

Thanks

"Allen Browne" wrote:

Add error-handling to the procedure that contains this line, and trap
error
2501.

Example:

Private Sub Command5_Click()
On Error GoTo Err_Handler

DoCmd.SendObject ...

Exit_Handler:
Exit Sub

Err_Handler:
If Err.Number <> 2501 Then
MsgBox "Error " & Err.Number & ":" & Err.Description
End If
Resume Exit_Handler
End Sub

"judith" <judith@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E2AF456C-6517-4FC3-992B-892D12BF18A7@xxxxxxxxxxxxxxxx
I am sending an email from the statement
DoCmd.SendObject acSendNoObject, "", acFormatTXT, strTo, , ,
strSubject,
strBody & strTemplate
This is great as it opens up the email for editing. But if i click
the
x
(close button) on the email with the intention of sending it to the
drafts
folder before sending, it gives an error "The send action was
cancelled"
and
if i just end it goes to the outbox anyway. Is there any way i can
stop
the
email sending if i change my mind at the last minute



.



Relevant Pages

  • RE: User Saving a Record else it deletes
    ... The code I posted simply does not undo if the user clicks no, ... > or tries to exit. ... >> Make a Cancel button on the form, ... >> End Sub ...
    (microsoft.public.access.forms)
  • Re: Record Validation Strategy
    ... Private Sub cmdExit_Click ... I would like to provide an exit button, ... I could Cancel, but I get an unwanted "Close Action cancelled" message. ... Dim intResponse As Integer ...
    (microsoft.public.access.forms)
  • Re: stop code sending cancelled email
    ... This should save it somewhere (inbox or drafts or something.) Then ... close the email without sending The cancel triggers error ... "Alex Dybenko" wrote: ... Private Sub Command5_Click ...
    (microsoft.public.access.modulesdaovba)
  • RE: User Saving a Record else it deletes
    ... before update command which only runs when the user scrolls to another record ... or tries to exit. ... > Make a Cancel button on the form, ... > End Sub ...
    (microsoft.public.access.forms)
  • Re: "Variable Not Defined"
    ... Cancel -- if set to true on Exit, ... > 'On Error GoTo ErrHandler ... > Exit Sub ...
    (microsoft.public.access.formscoding)