473,503 Members | 10,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using the where command along with a DoCmd.SendObject command

47 New Member
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 filter the records using the where comand and i am able to send using the DoCmd.SendObject command. but only seperately. Is it possible to insert the where command in the DoCmd.SendObject syntax??

Thanks
Jun 23 '08 #1
5 7562
ADezii
8,834 Recognized Expert Expert
Is it possible to insert the where command in the DoCmd.SendObject syntax??
No, there is no WHERE Clause in the SendObject() Method. Modify the Record Source of the Report to correctly Filter the Output.
Jun 23 '08 #2
neosam
47 New Member
No, there is no WHERE Clause in the SendObject() Method. Modify the Record Source of the Report to correctly Filter the Output.
Hi,

But the filter is not always the same. For example if the user requires data from a particular date, only this data should go to the required person. This is where i meet with a problem. is it possible to save a filtered data and then send it each time?

Thanks
Jun 23 '08 #3
ADezii
8,834 Recognized Expert Expert
I haven't actually tried this, but how about? (I'm using the Catalog Report from the Northwind Database for this example):
  1. Open the Report in Preview Mode Mode specifying your Where Clause
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.OpenReport "Catalog", acViewPreview, , "[CategoryName]  = 'Beverages'"
  2. Send the Report without listing its Name, this will efault to sending the Active Object
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.SendObject acSendReport, , acFormatRTF, "BSimpson@aol.com", , , "Subject Matter", "Message Text", False
  3. Close the Report and Save it
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.Close acReport, "Catalog", acSaveYes
Jun 24 '08 #4
neosam
47 New Member
I haven't actually tried this, but how about? (I'm using the Catalog Report from the Northwind Database for this example):
  1. Open the Report in Preview Mode Mode specifying your Where Clause
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.OpenReport "Catalog", acViewPreview, , "[CategoryName]  = 'Beverages'"
  2. Send the Report without listing its Name, this will efault to sending the Active Object
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.SendObject acSendReport, , acFormatRTF, "BSimpson@aol.com", , , "Subject Matter", "Message Text", False
  3. Close the Report and Save it
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.Close acReport, "Catalog", acSaveYes

Yipeeeee.... It works ... thanks
Jun 24 '08 #5
ADezii
8,834 Recognized Expert Expert
Yipeeeee.... It works ... thanks
You are quite welcome, I wasn't actually sure if it would or not.
Jun 24 '08 #6

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

Similar topics

0
2340
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...
1
9910
by: Alfred | last post by:
Hi I am using access 2002 1.0 I want to email a word or html file using the docmd.sendobject The document must be send as a attachment. 2.0 Second I would like to tell the Docmd.Sendobject to...
1
2396
by: Cameron | last post by:
Hi, I've attempted to make use of the Microsoft Knowledge Base Article "ACC97: How to Use a Recordset to Send Outlook E-Mail to Multiple Recipients - 318881" but I can't get it to completely...
2
3176
by: Lumpierbritches | last post by:
Hello, and thank you in advance for any and all assistance. I'm having a problem. This code worked years ago, what am I doing wrong? Private Sub SendeMail_Click() DoCmd.SendObject...
5
2236
by: Mark | last post by:
Hi All, Is there a way to (whilst using the sendobject command) use a query as the source of email addresses. I ask this because the list is constanly changing and I don't want to keep going into...
2
2700
by: Marcus | last post by:
Is there a way to have Access 2002 open a particular email client, when using DoCmd.SendObject? So far, Access simply opens the default email client that is set under Control Panel/Internet...
17
8777
by: DP | last post by:
hi, is there a way to send an e-mail to a customer, using ms access?? or some kind of automated mail merge, so the user only has to review the body, and click send? ive got a customer table,...
2
2300
by: John Taylor | last post by:
I have created a command button on a form that prints a filtered report and e-mails the report to three people when "clicked". The three email addresses are selected on the form by three combo...
2
9821
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...
0
7207
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
7095
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
7015
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
5602
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,...
0
4693
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
3183
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
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
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 ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.