Mass Mail Blues

Tezcatlipoca

Registered User.
Local time
Today, 14:58
Joined
Mar 13, 2003
Messages
246
Quick query regarding email sending from forms.

The current setup is as follows:


tblData
Holds the core data of my records. This includes a field - formatted to TEXT mode - called 'Email'.

frmData
The frontend of the data, designed so users can surf the records easily. This includes a field called 'Email' which is bound to the 'Email' table field and has an 'OnClick' event of:

Private Sub Email_Click()
DoCmd.SendObject , , , Me.Form!, , , , , , True
ExitHere:
ErrorHandlerExit:
End Sub[/I]


Now this setup works absolutely fine. Users can browse the database without any problems, and, with a single click on the 'Email' text box can open up Outlook, ready to send a mail.

My query is that my manager has recently asked if it is possible to send out mass mails, filtered by the data from another field. Specifically, I want to be able to have Outlook open up with the email addresses of every record whose 'Country' field contains a certain word, thus enabling me to mass mail all German records, or all Swiss, and so on.

Any thoughts?
 
Have a look at this thread this might help with emailing multiple people on your database. I have used a query here rather than a table to allow the relevant people to be emailed, however in my case the criteria is the same every time for sending the emails. It sounds as though you might have different criteria every time so it might be an idea to set up a search form where you can make selecection(s) then send the email based on what the user(s) have chosen.

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=32416&highlight=email

HTH
Hay
 
Hmmm...thanks for your help, but it's not quite what I was after. As you say, I think the answer lies in first filtering the required records (in this case by country), and then mass mailing from there.
 
Ok what you need to do is create a search form where you can make your selections then write these results to a query. This way the records will be filtered on what you have chosen. You could then base your current form on the query instead and have an email cmdbutton to take all the records in the query to outlook.
 
Thanks Hayley, much appreciated. Oh, incidentally, I can write a filtered query without any problem, but I'm a little shaky on the code I'd attach to the button to populate a new email's 'Send' field with all the filtered records. I can do it with one, so what do I need to change in the code to make it a mass mail?
 
How about I create you a little sample? I have something already in place which is similar so I can change that a little and send it onto you, which version of access are you using?

Also are you attaching a word document or anything or taking any of the field values?

Hayley
 
That would be good of you. I'm running Access 2000 on a Windows 98SE OS, and no, I'm not needing to attach anything to the mail, just populate the 'Send' section with multiple email addresses from my records.
 
Here's a little sample for you

Open the form FrmSearchContracts and make a selection from one of the combo boxes probably the best bet is to use the ContractType combo and choose Software licence as I have deleted most of the data > search > all search results displayed for this selection along with the email addresses. Choose Email, please not that in the coding it is set to False meaning send them without first viewing the email in outlook. This will loop through all the filtered records sending an email until the end of the recordset.

You will get a runtime error with this example - reason for this is because there are some Null email address with this selection, I only have four to test this with;)

If anyone else does trial this example please change the email addresses to match your own rather than mine before clicking the send button as I'm going on holiday and will come back to loads of emails without tests coming through as well - thx!

Hope this is what you are looking for.
Hay
 

Attachments

Users who are viewing this thread

Back
Top Bottom