Access97/Outlook2003 automation

G

Guest

I am a relatively new Access user and am seeking assistance in generating
automatic e-mails from Access 97 via Outlook 2003.

I am currently using two tables:

1). tblData: This is a large (110Mb) linked dBase IV table that is generated
‘live’ by a proprietary DOS-based application and contains all of the data to
be e-mailed;

2). tblContacts: This table contains three fields:

* EAddress: Lists each recipient’s e-mail address;
* SendY/N: Determines which recipient will receive an e-mail (True/False);
* LinkCode: Links records in ‘tblContacts’ with those in ‘tblData’ by record
number, with the number treated as a text string, as the dBase application
treats this as text.

I have set up a query (qryUserdata) and an associated report (rptUserdata)
which assembles all of the data to be e-mailed from both tables. This is all
working correctly.

However, the only e-mail generation code I have been able to locate to date
is:

DoCmd.SendObject acSendQuery, "qryUserdata", “RichTextFormat(*.rtf)â€,
"name@url", , , " Subject………"," E-mail Body ………….", False

DoCmd.Quit

I would like to know how to create a Command button (or other Form
component) that can loop through the records displayed by the Query, firstly
determining whether the ‘Send Y/N’ flag has been set to ‘True’, and then
generating a separate e-mail message for each recipient, their e-mail address
as per the 'EAddress' field, and the remaining data drawn from 'tblData'.

N.B. I have opted for a Rich Text Format report, as a table (spreadsheet)
format would be too difficult for the report recipients to interpret.

I look forward to your response.

Regards,
Jim Bendfeldt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top