The email addresses are contained in an Access table of unique values. Here
is the SQL view of the query that accesses the table of addresses that "get
all data" and the code from the module that builds the bcc list in Outlook:
SELECT tblReceiveAllData.EmailAddress
FROM tblReceiveAllData
ORDER BY tblReceiveAllData.LastName;
Public Sub ReceiveAllData()
Dim db As DAO.Database, rs As Recordset
Dim strSQL, varBCC As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("Select * From qryReceiveAllData",
dbOpenDynaset)
'Check to see if recordset is empty
If rs.RecordCount < 0 Then
MsgBox ("Gotta problem - no records")
End If
rs.MoveLast
rs.MoveFirst
varBCC = ""
Do While Not rs.EOF
varBCC = varBCC & rs![EmailAddress] & ";"
rs.MoveNext
Loop
Call SendEmail(varBCC)
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
:
By any chance are you using a query to select the recipients to receive
the EMAIL? If you are, open the query and confirm that the query is
selecting UNIQUE values. Otherwise, please post the code and explain
what you mean by 'ACCESS LIST'. Are you storing the email messages in
Access and loading up the TO field from there? Are you storing CONTACT
information, then loading up the TO field letting Outlook fill in the
email addresses? (Hint: If your doing the later, double check that you
don't have a distribution list in the table).
lcJim wrote:
Multiple copies of Outlook message is sent to recipients. The recipients are
on an Access list that is called from a VBA module. The list contains 145
recipients. The VBA code works without sending multiple copies on other
lists. Suggestions?