PC Review


Reply
Thread Tools Rate Thread

Email Report question

 
 
sue gray
Guest
Posts: n/a
 
      16th Sep 2009
I have a multi page report that has employee information on separate pages.
Ex: John Doe, page 1, Jane Doe, Page 2 .. Etc.. I want to be able to email
the page for john doe to john doe, and jane doe to jane doe, with one command
button. I can email the whole report, but can't figure out how to begin to
select individuals. I have done a lot of reading on here, but it's still not
clear. ANy help would be greatly appreciated.
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      17th Sep 2009
Hi,
you can do the following:
make a new query "MyQuery" based of your report's recordsource
set report's recordsource to this query

open recordset to loop through employees
for each employee create a query based of your report's recordsource, but
filtered by employee (you can use currentdb.querydefs("myquery").sql=...)
send report to current employee using docmd.sendobject

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"sue gray" <(E-Mail Removed)> wrote in message
news:FBEBB107-9B8E-46FE-B021-(E-Mail Removed)...
> I have a multi page report that has employee information on separate
> pages.
> Ex: John Doe, page 1, Jane Doe, Page 2 .. Etc.. I want to be able to
> email
> the page for john doe to john doe, and jane doe to jane doe, with one
> command
> button. I can email the whole report, but can't figure out how to begin
> to
> select individuals. I have done a lot of reading on here, but it's still
> not
> clear. ANy help would be greatly appreciated.


 
Reply With Quote
 
sue gray
Guest
Posts: n/a
 
      17th Sep 2009
Thanks for the reply. Can you give me more details? I am ok with the first
steps, but don't have any idea how to handle the second paragraph. Thanks.

"Alex Dybenko" wrote:

> Hi,
> you can do the following:
> make a new query "MyQuery" based of your report's recordsource
> set report's recordsource to this query
>
> open recordset to loop through employees
> for each employee create a query based of your report's recordsource, but
> filtered by employee (you can use currentdb.querydefs("myquery").sql=...)
> send report to current employee using docmd.sendobject
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
>
> "sue gray" <(E-Mail Removed)> wrote in message
> news:FBEBB107-9B8E-46FE-B021-(E-Mail Removed)...
> > I have a multi page report that has employee information on separate
> > pages.
> > Ex: John Doe, page 1, Jane Doe, Page 2 .. Etc.. I want to be able to
> > email
> > the page for john doe to john doe, and jane doe to jane doe, with one
> > command
> > button. I can email the whole report, but can't figure out how to begin
> > to
> > select individuals. I have done a lot of reading on here, but it's still
> > not
> > clear. ANy help would be greatly appreciated.

>
>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      18th Sep 2009
Hi,
here some air code, hope it explains my idea:

set rst=currentdb.openrecordset("MyQueryWithEmployees",dbopenforwardonly)
do until rst.eof
currentdb.querydefs("myquery").sql="Select .... From .... Where
EmployeeID=" & rst.EmployeeID
docmd.sendobject acSendReport,"MyReport",,rst!Email
rst.movenext
loop

see OpenRecordset Method in access help for details opening recordset


--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"sue gray" <(E-Mail Removed)> wrote in message
news:36D5E438-3216-471B-AE08-(E-Mail Removed)...
> Thanks for the reply. Can you give me more details? I am ok with the
> first
> steps, but don't have any idea how to handle the second paragraph.
> Thanks.
>
> "Alex Dybenko" wrote:
>
>> Hi,
>> you can do the following:
>> make a new query "MyQuery" based of your report's recordsource
>> set report's recordsource to this query
>>
>> open recordset to loop through employees
>> for each employee create a query based of your report's recordsource, but
>> filtered by employee (you can use currentdb.querydefs("myquery").sql=...)
>> send report to current employee using docmd.sendobject
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://accessblog.net
>> http://www.PointLtd.com
>>
>>
>> "sue gray" <(E-Mail Removed)> wrote in message
>> news:FBEBB107-9B8E-46FE-B021-(E-Mail Removed)...
>> > I have a multi page report that has employee information on separate
>> > pages.
>> > Ex: John Doe, page 1, Jane Doe, Page 2 .. Etc.. I want to be able to
>> > email
>> > the page for john doe to john doe, and jane doe to jane doe, with one
>> > command
>> > button. I can email the whole report, but can't figure out how to
>> > begin
>> > to
>> > select individuals. I have done a lot of reading on here, but it's
>> > still
>> > not
>> > clear. ANy help would be greatly appreciated.

>>
>>

 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      20th Sep 2009
sue gray <(E-Mail Removed)> wrote:

>I have a multi page report that has employee information on separate pages.
>Ex: John Doe, page 1, Jane Doe, Page 2 .. Etc.. I want to be able to email
>the page for john doe to john doe, and jane doe to jane doe, with one command
>button. I can email the whole report, but can't figure out how to begin to
>select individuals.


For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/emai...ttachments.htm


Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Granite Fleet Manager http://www.granitefleet.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Losing ability to send report as Email (export as MAPI) in Crystal report Bill Nguyen Microsoft VB .NET 0 8th May 2007 01:33 AM
Filtering report and sending each filtered report by email;records =?Utf-8?B?Z3ZzYW5kcnM=?= Microsoft Access Reports 0 31st Aug 2006 05:56 PM
Email A Report Question =?Utf-8?B?U3R1Sm9s?= Microsoft Access 3 13th Jun 2006 02:03 AM
email a report in access, so receiver can input data to report =?Utf-8?B?bWFyY3lAYWlycHJvZHVjdHM=?= Microsoft Access Reports 1 4th Nov 2005 12:43 PM
Report(s) -Email Question Randy Fritz Microsoft Access Form Coding 0 21st May 2004 08:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 PM.