splats
Technical User
- Jan 2, 2003
- 131
Hello folks
Here is my code for a command button. I am getting a type mismatch error (run time error '13'). The problem seems to be in Set rs = db.OpenRecordset(sql)
Is it possible that I need a reference checked? I am stuck! Thanks in advance!
Private Sub EmailPersonal_Click()
Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "Select from [QU-EmailPersonal]"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!Email) Then
'build up email addresses separated by a semicolon
emailTo = emailTo & rs!Email & "; "
End If
rs.MoveNext
Loop
DoCmd.SendObject acSendNoObject, , , emailTo
End Sub
Here is my code for a command button. I am getting a type mismatch error (run time error '13'). The problem seems to be in Set rs = db.OpenRecordset(sql)
Is it possible that I need a reference checked? I am stuck! Thanks in advance!
Private Sub EmailPersonal_Click()
Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "Select from [QU-EmailPersonal]"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!Email) Then
'build up email addresses separated by a semicolon
emailTo = emailTo & rs!Email & "; "
End If
rs.MoveNext
Loop
DoCmd.SendObject acSendNoObject, , , emailTo
End Sub