Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Report via Email - Once again!

Status
Not open for further replies.

budich

Programmer
Oct 7, 2000
79
0
0
ID
Hi Guys,

I am still have problem with sending report via Email such as sending Purchase Orders which are it's specific to each supplier. What I have got from this forum are :
1. sending report by email to some recipients by putting all the recipients into the "send to" field.
2. sending report by email to some recipients by putting one recipient into the "send to" field. Same with the thread :How to email to all "recipients" records in a table
thread181-34987

for those threads, it all sending the same "content" report to all recipients (this is my understanding).
MY QUESTION IS : HOW IF WE WILL MAKE DIFFERENT "CONTENT" REPORT specific to each recipients (such as purchase order) or how to add the parameter criteria in the query reports then email it ?
Thank you in advance.
 
Budi -- Here's some pseudocode that might get you going:


------------------------------

[assemble and open recordset (rst) of all recipients who are to receive email, then]

do while not rst.eof
dim qdf as dao.querydef
set qdf = currentdb.querydefs("qryForRecipients")

dim strSQL as string
strSQL = ". . . WHERE recipient_id = " & rst.recipientID

qdf.SQL = strSQL

qdf.Close

docmd.sendobject [reference report that
has "qryForRecipients" as recordsource]

Loop

----------------------------------------

The method above will loop through a recordset including all recipients who should get email, save a different
query for each one, and send a report object that uses that query as its recordsource. Probably will need some tweaking, but something like that can be used to get different report mailed to each recipient.

-- Herb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top