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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop Through Email Address Field

Status
Not open for further replies.

wlwoman

Technical User
Jul 8, 2001
133
US
I have a field EMAILADR as part of a continuous form. I need to loop through the email addresses and send the same message to each recipient until all recipients with a null date notified field NOTDAT have been emailed. I know I can do this with a loop but have not the first idea how to write it.

Recipients are added sporadically, and the SendObject is activated via a submit button. When the button is clicked, I want just those people with a null notify date to be emailed. The SendObject action will notify only the first person in the list.

If someone can show me how to write this, I will save it and never ask the same question again!
 
Clarification

I am using DoCmd.SendObject in Access 2007 (with Outlook) for email follows:

DoCmd.SendObject acSendReport, "rptmyreport", acFormatPDF, [EMAILADR] , ,"myself", "New Report", "Go Perform This Action", False

[EMAILADR] is a field in the active form and has a NOTDAT field to show the date when the email was sent. The resultant email only sends the report to the person in the first record. I need to send it to all email addresses that have not received a notification.

Since the email is sent in the background, individual emails would be fine, although if there is a way to get all of the addresses into a single field ("EMAILADR, EMAILADR, EMAILADR" it would cut down the load on the email server.

This is the first time I have had to send to multiple recipients. From reading other posts, it looks like looping through the EMAILADR field until all of NOTDAT = NULL is what I need to do, but I have absolutely no experience with this and have not been able to modify 'found' code to work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top