By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

using the where command along with a DoCmd.SendObject command

P: 47
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
Share this Question
Share on Google+
5 Replies


ADezii
Expert 5K+
P: 8,628
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

P: 47
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
Expert 5K+
P: 8,628
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

P: 47
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
Expert 5K+
P: 8,628
Yipeeeee.... It works ... thanks
You are quite welcome, I wasn't actually sure if it would or not.
Jun 24 '08 #6

Post your reply

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