473,486 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SendObject Command Freezes if user cancels

3 New Member
I'm rather new to writing VB, well actually about 3 weeks, so please go easy.

I'm using Office 2003 and have the following code in an Access data base:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command126_click()
  2. On Error GoTo Err_Command126_click
  3.  
  4.         Dim stDocName As String
  5.         stDocName = "Ideas report - current record"
  6.         DoCmd.SendObject acReport, stDocName, acFormatSNP, , , , "The attached initiative log may be of interest to you", "Title: " & Me.Title, N
  7.  
  8. Err_Command126_click:
  9.     MsgBox Err.Description
  10.     Resume Exit_Command126_Click
  11.  
  12. Exit_Command126_Click:
  13.     Exit Sub
  14.  
  15. End Sub
This works absolutely fine and generates an e-mail with attachment. If the user decides not to send the e-mail and cancel (i.e. close e-mail message without saving) it returns to the original form - fine.

However, if I amend Start-up options not to Display Database Window. The same function generates the below message if the operator cancels the e-mail.

"The Send Object was Cancelled"
"You used a method of DoCmd object to carry out an action in VB, but then clicked cancel in the dialog box"

The form now locks and can only be exitted using CTRL+ALT+DEL

I've read lots of posts about error handling and Err 2501, but the error appears to be happening before it gets to the Error handling.

Please help I've been stuck for 6 hours now!
Jun 10 '10 #1
3 2920
MMcCarthy
14,534 Recognized Expert Moderator MVP
From what I can understand this can happen if your form is set as popup. For some reason this command treats the form as modal. Set the form behavior to normal and see if that solves your problem.
Jun 11 '10 #2
plaskettm
3 New Member
Changed form to Pop-up = No and the error no longer occurs. Brilliant, many thanks for your help
Jun 14 '10 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
You're welcome :)
Jun 14 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1444
by: gao_bolin | last post by:
Does anybody know why the following lines would freeze python : import popen2 a = popen2.Popen3('ps -A') a.wait() Thanks B.
0
2338
by: Bret Shortall | last post by:
Using the SENDOBJECT action command in a Macro works fine if you hard code in their email address. SENDOBJECT TO bret@emailaddress.com SUBJECT This is the Subject line...
8
5050
by: Andy Kasotia | last post by:
Warning message in Outlook 2003 while using SendObject. When i try to use sendobject to send an email, a warning massage pops up, saying that "Outlook is trying to send an email.......if this is...
0
1361
by: Simon McCulloch | last post by:
Hi all I have an ASP.net website that uses an aspx page locate and stream a file to an authenticated user and I'm getting the error Aspnet_wp.exe (PID:XXXX) stopped unexpectedly which the user...
2
1268
by: CR | last post by:
How do you know if the user cancels out of the FolderBrowserDialog object?
1
2267
by: central_scrutinizer | last post by:
I have an ASP that has been working fine for several months, but it suddenly broke. I wonder if windows update has installed some security patch that is causing it. The problem is that I am...
3
1833
LBryant
by: LBryant | last post by:
First of all, I want to say how thrilled was to find this forum and how much I value the expertise here. Now, here's my quandry. I have a form bound to a query that pulls a single record from a...
5
7555
by: neosam | last post by:
Hey all, I am not able to integrate these 2 actions in one command. What i am doing is... A button which sends a report with only specific data to a particular person (via outlook). I am able to...
1
1673
by: bluerooster | last post by:
I have written code in order to send a report using the SendObject command in Access2003. It all works fine, however, I would like to know if there is anyway to use code in order for the command to...
2
4297
by: ClearRift | last post by:
I've created an Access application in the 2003 file format that includes a button for the user to send a report via e-mail. The computers at work use Office 2007 products on Windows XP Pro with SP-3...
0
7094
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
6964
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
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5427
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,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.