473,432 Members | 1,692 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,432 software developers and data experts.

Error when using DoCmd.SendObject ac

Received the following error when clicking the command button to send the form in XLS format to recipients:

"The expression On Click you entered as the event property setting produced the following error: User-defined type not defined.

* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro"

Here is the Code that I used:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command_Click()    .
  2.       DoCmd.SendObject acSendForm, "myForm", acFormatXLS, "someone@somewhere.com", , , _
  3.                     "Email with attached report", "This is the email body.", True
  4. End Sub
Looking for assistance in figuring out what I need to change in order to get this to work. I am using Access 2007-2016 (not my choosing). Thank you!
Aug 17 '23 #1

✓ answered by NeoPa

Hi CRAZImat.

Welcome to Bytes.com.

It looks like you've missed out a comma (,) from your invocation of the method (SendObject). You appear to have set the [Bcc] parameter to what looks like it might be your [Subject], and thus set [EditMessage] to True. It probably won't like that ;-)

I should add that using positional parameters for methods with a complex list of parameters is not generally advisable. Named parameters makes much better sense (in such cases) and leads to far fewer problems.

1 12011
NeoPa
32,556 Expert Mod 16PB
Hi CRAZImat.

Welcome to Bytes.com.

It looks like you've missed out a comma (,) from your invocation of the method (SendObject). You appear to have set the [Bcc] parameter to what looks like it might be your [Subject], and thus set [EditMessage] to True. It probably won't like that ;-)

I should add that using positional parameters for methods with a complex list of parameters is not generally advisable. Named parameters makes much better sense (in such cases) and leads to far fewer problems.
Aug 17 '23 #2

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

Similar topics

0
by: toufik toufik | last post by:
I've the folowing error "Call to undefined function: phtmldec() " when using a script encrypted with PHTML Here are the steps done: - I've Appache (windows XP), PHP434 - using PHTML, I've...
5
by: Andrew James | last post by:
Gentlemen, I'm running into a problem whilst testing the parsing of a language I've created with TPG . It seems that for some reason, TPG balks when I try to parse an expression whose first...
1
by: Dermot O'Loughlin | last post by:
Can anyone help me with this? I get the following error when using the odbc adapter wizard in VS.Net 2003: --------------------------- Wizard Form --------------------------- An unexpected...
0
by: Charlie | last post by:
Hi: I get a TreeNode binding error when using Data property of XmlDataSource control. When I switch to TextFile property and point to xml file on hard drive, problem goes anyway. I'm...
0
by: =?Utf-8?B?TG93bGFuZGVy?= | last post by:
Hello, I've built a web application that uses client script callbacks. It is used on a large network with a large variety of user OSes and IE versions. It was tested on IE 6 on different setups...
2
by: Mac Campbell | last post by:
When automating e-mail messages from Access 2003 using DoCmd.SendObject, I get an Outlook warning message "A program is trying to automatically send e-mail on your behalf. Do you want to allow...
8
by: msnews.microsoft.com | last post by:
Our IT team relocated our application servers yesterday. They had to take one machine out of the cluster because it would prompt users for credentials if accessed using the IP address, which I...
7
by: svsenthilkumar | last post by:
Hai, I got an javascript error when using ajax in mozilla browser, anyone help me why the error is coming, meaning for this error and how can i rectify this error. Error: " nsresult:...
2
iBasho
by: iBasho | last post by:
Hi, I am trying to set up a notification email that would come to my email everytime users click on a command button in a form. I am using the DoCmd.SendObject command without actually sending any...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.