Hey all,
I have a table (tblSales) that has several contacts in it. I want to send 1 email to all recipients where their check box is checked.
here is my code
I can't seem to get this to work with muliple email addresses. Any thoughts?
I've attached an image of the form. Fields with "C" at the end are checks.
I have a table (tblSales) that has several contacts in it. I want to send 1 email to all recipients where their check box is checked.
here is my code
Code:
Private Sub SendBtn_Click()
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.Application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
Dim OlkRecip As Outlook.Recipient
Set OlkRecip = .Recipients.Add(Me![AgentL.E-mailAddress])
If ([LenderC]) = False Then
Else
.Recipients.Add (Me![Lender.E-mailAddress])
End If
If (Me![BuyerC]) = False Then
Else
.Recipients.Add (Me![Buyer.E-mailAddress])
End If
If (Me![SellerC]) = False Then
Else
.Recipients.Add (Me![Seller.E-mailAddress])
End If
If (Me![AgentSC]) = False Then
Else
.Recipients.Add (Me![AgentS.E-mailAddress])
End If
If (Me![EscrowC]) = False Then
Else
Set OlkRecip = .Recipients.Add(Me![Escrow.E-mailAddress])
End If
OlkRecip.Type = olTo
.Subject = Me![tblProperty.Address]
.Display
End With
Set Olk = Nothing
Set OlkMsg = Nothing
Set OlkRecip = Nothing
End Sub
I can't seem to get this to work with muliple email addresses. Any thoughts?
I've attached an image of the form. Fields with "C" at the end are checks.