Need help emailing a report - via code.

F

FatMan

Hi all:
Not sure if this is the right spot for this post or not. If it is not then
please forgive me and let me know where it should be posted.

What I currently have is a form the user fills in the selection criteria for
a report and then prints it. The selection criteria can be a range of
customers (from 1 to 99 customers) and the product (from 1 to 99 products),
etc. There is a forced page break between each customer. This report works
great for our monthly mail outs but now we would like to send out the report
more frequently via email.

What I would like to do is have the user fill in the selection criteria as
they now do but instead of printing the report have it email (in PDF format)
each customer just their portion of the report. My Customer table contains
the email address to be used in a field called CustomerEmail. The name of
the report is rptCustSales.

Can someone please tell me if this can be done and if so how?

Any help is greatly appreciated.

Thanks,
FatMan
 
S

Stephen Lynch

Off the top of my head, you will probably have to do a loop when you send
the names of the companies to a recordset and then run through the loop
creating a seperate report for each company using the company as the
parameter.

Something like this:

Run report using 1st company is recordset as the parameter
Pdf it and attach it to email
Send the email address and subject matter to outlook
send the email
loop to the next company
stop at end of file
 

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