473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

What's wrong with my email code?

I have a tick box control that when checked opens Outlook and attaches a
report. If the user clicks send then everything is OK. BUT if the user
clicks the close on Outlook without sending the email I want to trap the
error message 2501 and ask the user what to do. Here is my code so far:
Private Sub Loadtxt_Click()
On Error GoTo Exit_Handler
If Me!Loadtxt = True Then
DoCmd.SendObject acSendReport, "rptOnlineUpload", acFormatRTF, , , ,
"OnLineUpload", "Please upload this document to Online", True
End If
Exit_Handler:

If Err.Number = 2501 Then
If vbCancel = MsgBox("You have not sent the email, click OK to send or
Cancel to cancel the message", vbOKCancel, "Email not sent") Then
Cancel = True
Else
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler
End If
End If
End Sub

If they close Outlook without sending the message then Outlook closes and no
message pops up and the email isn't sent. It just closes whether or not they
have filled in an email address. If they click Cancel then Outlook closes
but the tick box is still checked which it shouldn't be because the email
hasn't gone.
Can anyone help me here?
TIA Tony Williams
Nov 12 '05 #1
0 1416

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
11
by: Dart | last post by:
This code is okay: class CSingle { public: static CSingle membs; int MEM_NUM; CSingle(int n) { }
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
5
by: cc0064263 | last post by:
hello, i am very new to C and i am reading K&R and i came accross this code in the book. K&R says that it is incorrect to free something after it has been freed and gives this as an example. ...
6
by: Niklaus | last post by:
Hi, Can someone point out what is wrong with this code ? How can i make it better optimize it. When run it gives me seg fault in linux. But windows it works fine(runs for a long time). Do we...
18
by: Matt | last post by:
Hi, I have a probelm here: If I declare: char *p="Hello";
8
by: Thaqalainnaqvi | last post by:
Several times I logged-in successfully but after log-in I can't use features/services which were shown prior to my login. Can anyone exoert from this forum check , is it technical fault of Bank...
9
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
6
by: MyMarlboro | last post by:
i wish to compare 1 file with multiple files (in a folder) @allfile - >> the paths for all files in a folder but once i run the code below, it keep loop at print "comparing $masterfile with...
1
by: Michelle Chase | last post by:
Option Compare Database 'this one is to use to concatenate the fields Function combine_descriptions() 'turn off warning dialog DoCmd.SetWarnings (False) Dim rst As Recordset Dim...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.