Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email column from access 2002 using outlook

Status
Not open for further replies.

splats

Technical User
Jan 2, 2003
131
0
0
Hello folks

I have a database Access 2002. I would like to email all email addresses in a table using Outlook 2000 directly from a command button on a form.

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
 
I found the answer it is at thread181-511371
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top