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

Using SendReport to email to each recipient listed in a query

I have a report which contains the invoices for all customers (ie one
page for each customer) the email address is recorded in each customer
record. What I would like to do is either send the appropriate page to
the appropriate customer; or run the report for each customer listed in
a query seperately all at the push of a button. I don't want much do I?

Jul 28 '06 #1
1 1450
I have the same thing, a table that contains an email address for each
customer and I do it like this:

Const strEmailTable As String = "tblEmailAddrs"
Const strReportName As String = "rptChargesMain"
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
Dim strEmailList As String

Set db = CurrentDb
strSQL = "Select * from " & strEmailTable
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
With rs
Do Until .EOF
DoCmd.OpenReport strReportName, acViewDesign, , , acHidden

(What ever code you need to modify query or report)

DoCmd.Close acReport, strReportName, acSaveYes
strEmailList = !emailaddrs
DoCmd.SendObject acSendReport, strReportName, acFormatRTF,
strEmailList, , , "Quarterly Reports", "Report Attached", False
.MoveNext
Loop
End With

Return

"colin spalding" <co***********@btopenworld.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
>I have a report which contains the invoices for all customers (ie one
page for each customer) the email address is recorded in each customer
record. What I would like to do is either send the appropriate page to
the appropriate customer; or run the report for each customer listed in
a query seperately all at the push of a button. I don't want much do I?

Jul 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maggie Blue | last post by:
Hi! Total "newbie to programming" here. I'm using Jack's Formmail.php, code at: http://www.dtheatre.com/scripts/source_view.php?path=formmail_code/formmail.phps and I'm trying to figure out...
14
by: squash | last post by:
What html code would I need to insert in an email to track if the recipient opened it? I was thinking something that could access a cgi script which I could write. Or perhaps some trick with the...
0
by: MikeM | last post by:
The email address stays through each loop and keeps adding the next email address. joe@email.com then the next run would be joe@email.com; mike@email.com etc... The subject and the attached file...
3
by: Baz'noid | last post by:
Hi all, With the recent postal strikes here in the UK i'm trying to persuade access to email reports at the touch of a button. I've not been able to figure out how to filter the report - when i...
4
by: acni | last post by:
I have the following peice of code to try and send an email to selected contacts in my form.The problem is this line: StrStore = DLookup("", "qrySelectEmail", "??????") This looks up the email...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
3
by: Auddog | last post by:
I have the following query that works in mysql: select id, order_no, price, count(item_no), sum(price) from production WHERE item_no = '27714' group by item_no; When I setup my query in php,...
0
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing...
1
by: JM420A | last post by:
Platform: Access 2003 I have a table that has one record, need to pull the EmailAddress field to set as a value for a SendReport Command. I have searched for examples on line as to how to do...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.