473,396 Members | 1,893 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,396 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 1420

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.