Create an email using some fields from access - is this possible ?

I

Isis

I have an access database with records containing email address and various
other things - can I get access produce emails using a standard email
template and fill in fields from the database and only use some records
based on the value of a field ?

Any help or pointers appreciated

Thanks
 
M

MikeJohnB

Hi Isis

I have the following code which works well for me, I don't know if you can
use this by changing the field and control names to your fields and controls?

Hope this helps

Private Sub SendEMailButton_Click()
On Error GoTo Err_SendEMailButton_Click

Dim stDocName As String
Dim StrTo As String
Dim StrSubject As String
Dim Pge As String

StrTo = DLookup("[E_Mail_Address]", "[Tbl_Contact]", "[Contact]='" &
Forms![Frm_General_Enquiries]![ContactCombo95] & "'")
stDocName = "Rprt_Quote_By_E_Mail"
DoCmd.SendObject acReport, stDocName, To:=StrTo, Subject:="Our Quotation
Ref " & Me.Reference_No

Exit_SendEMailButton_Click:
Exit Sub

Err_SendEMailButton_Click:
If StrTo = "" Then
MsgBox "You have NO E MAIL ADDRESS to send to???????"
Exit Sub
End If
MsgBox Err.Description
Resume Exit_SendEMailButton_Click

End Sub
 
Top