Hi again,
I was reading through the forums on another website and came across the following. I think this will help me to do what I need to get done. However Im not entirely sure as to how to exactly go about doing this. I am using the Contact Management Database template from MS Office website. My questions are as follows:
1. How exactly do I change the record source? and where? Is this the same as the row source?
2. Where do I insert the following code?
3. If you're familiar with the template, will the following work as is or do I need to tweak anything?
If you have any questions, please do not hesitate to ask.
Thank you all for your help!
---
Ok, Lets be specific then. Since you want to send one e-mail to a group of people then you need to build a distribution list. For this you will use a Multi-select list box that lists all the e-mail addresses of the volunteers. The RecordSource of that list box will look like this:
SELECT Lastname & ", " & Firstname AS Fullname, E-Mail FROM tablename ORDER BY Lastname, Firstname;
You would set the bound column for the list box to column 2.
Next you can use code like the following to create your distribution list:
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strCC As String, strSubj As String, strBody As String
Set frm = Form!frmMyForm
Set ctl = frm!lbMultiSelectListbox
strCC = ""
For Each varItem In ctl.ItemsSelected
strCC = strCC & ctl.ItemData(varItem) & "; "
Next varItem
'Trim the end of strSQL
strCC=left$(strCC,len(strCC)-2))
Finally, you would add the SendObject command to this code after defining the Subject (strSubj) and Body (strBody) of the e-mail
strSubj = "subject of e-mail"
strBody = "body of e-mail"
DoCmd.SendObject acSendNoObject,,*** Email address is removed for privacy ***,,strCC, strSubj, strBody
What this will do is send an e-mail ot some address and send a BCC to the distribution list. You can lookup the SendObject method for more details and options.
---