Please Help! Outlook emailshot using Access Database (1 Viewer)

sophy2502

New member
Local time
Today, 01:44
Joined
Oct 24, 2012
Messages
1
Hi, I'm new to Access but seem to be finding my way around ok. Having a problem though and hope you can help:

I need to let all our suppliers know we have moved and wanted to do this by email. Can anyone tell me how I use Access database of suppliers email addresses and use them on Outlook.

Sorry if I haven't explained that too well!

Sophy
 

djshrew

Registered User.
Local time
Today, 01:44
Joined
May 29, 2006
Messages
60
1. Create a query
2. Create a button on your form.
3. added this code behind the button.

Code:
Private Sub [COLOR="Red"]Command55_Click()[/COLOR]


On Error Resume Next

If MsgBox("This will email all contacts in the database.  Continue?", _
           vbExclamation + vbYesNoCancel) = vbYes Then

Dim strMailList As String, rs As Recordset

Set rs = CurrentDb.OpenRecordset("[COLOR="Red"]Query Name[/COLOR]", dbOpenDynaset)

With rs
  .MoveFirst

    Do
      strMailList = strMailList & !Email & ";"
        .MoveNext
    Loop Until .EOF

      If Not IsNull(!EmailName) Then
  strMailList = strMailList & !Email & ";"
End If
        .Close
End With

  DoCmd.SendObject acSendNoObject, "Blank", acFormatSNP, strMailList, , , "[COLOR="Red"]your email subject[/COLOR]" _
  , , True

End If

Set rs = Nothing

End Sub

Red bits need changing. :)
 

Users who are viewing this thread

Top Bottom