what's the required code to send Email from access form and the record be attached?
to [contractorEmail]
cc [ContracHolderEm ail]
to [contractorEmail]
cc [ContracHolderEm ail]
Private Sub Command88_Click()
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim stID As String '-- The ID from form
Dim stWho As String '-- Reference to tblUsers
Dim stApprovedBy As String '-- Person who approved Violation
Dim strSQL As String '-- Create SQL update statement
Dim errLoop As Error
'-- Combo of names to assign ticket to
stWho = Me.ApprovedBy
stWhere = "tblApprovedBy.ApprovedBy"
'-- Looks up email address from tblApprovedBy
varTo = DLookup("[EMail]", "tblApprovedBy", stWhere)
stSubject = ":: New Violation ::"
stID = Format(Me.ID, "00000")
RecDate = Me.Date
'-- User who prepare violations
strUserName = Me.UserName.Column(1)
stText = "You have been recieved a new violation." & Chr$(13) & _
Chr$(13) & "Violation number: " & ID & Chr$(13) & _
"This Violation has been sent to you for Approval by: " & strUserName & _
Chr$(13) & "Received Date: " & RecDate & Chr$(13) & _
Chr$(13) & "This is an automated message." & _
" Please do not respond to this e-mail."
'Write the e-mail content for sending to assignee
DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
End Sub
stWhere = "tblApprovedBy.ApprovedBy"
varTo = DLookup("[email]", "tblApprovedBy", stWhere)
stWhere = "[ApprovedBy] = '" & stWho & "'"
Comment