Hi everyone
I'm getting a run-time error 13 Type mismatch on line 60 of my vba code.
I'm very confused and not sure what is causing the error.
Any help will be highly appreciated.
I'm getting a run-time error 13 Type mismatch on line 60 of my vba code.
I'm very confused and not sure what is causing the error.
Any help will be highly appreciated.
Code:
Private Sub Form_Load()
ContactList.RowSource = ""
Dim SearchSQL As String
SearchSQL = "SELECT tblContacts.ContactID, tblContacts.FirstName, tblContacts.Email, tblContacts.Followup " & _
"From tblContacts " & _
"WHERE (((tblContacts.FollowUp) = True)) " & _
"ORDER BY tblContacts.FirstName;"
ContactList.RowSource = SearchSQL
End Sub
Private Sub SendTheEmailSMTP_Click()
Dim MResponse As Integer
Dim msgBody As String
Dim strSQL As String
Dim Contact As String
Dim ContactID As Long
Dim db As Database
Dim i As Long
Dim strSubject As String
Dim msgTo As String
Dim msgFrom As String
Dim msgReplyTo As String
Dim msgSubject As String
10 If Forms!frmContactEmails!ContactList.ItemsSelected.Count < 1 Then
20 Exit Sub
30 End If
40 For i = 0 To Forms!frmContactEmails!ContactList.ListCount - 1
50 Contact = Forms!frmContactEmails!ContactList.Column(1, i)
60 ContactID = Forms!frmContactEmails!ContactList.Column(0, i)
70 msgFrom = "houseofpaws@redrobiena.com.au"
80 msgTo = Forms!frmContactEmails!ContactList.Column(2, i)
90 msgReplyTo = "houseofpaws@redrobiena.com.au"
100 msgBody = "Dear " & Forms!frmContactEmails!ContactList.Column(1, i) & "<br><br>" _